From da4dd490d0def879fcec9273cdb001c7ffcf162e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Thu, 20 Mar 2025 13:46:19 +0100 Subject: [PATCH] Cleanup: explicitly silence linter for empty `else` clause The `else` block does contain a comment to explain what situation we're in when the `if` condition is false. I like that construct, but golangci-lint did not. No functional changes. --- internal/manager/task_logs/task_logs.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/internal/manager/task_logs/task_logs.go b/internal/manager/task_logs/task_logs.go index 7762dd42..1902a9e2 100644 --- a/internal/manager/task_logs/task_logs.go +++ b/internal/manager/task_logs/task_logs.go @@ -216,7 +216,8 @@ func (s *Storage) Tail(jobID, taskID string) (string, error) { firstNewline := bytes.IndexByte(buffer, byte('\n')) if 0 <= firstNewline && firstNewline < numBytes-1 { buffer = buffer[firstNewline+1:] - } else { + } else { //nolint:staticcheck + // nolint: because I (Sybren) want to keep the 'else' + the comment it contains // The file consists of a single line of text; don't strip the first line. } }