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.
This commit is contained in:
Sybren A. Stüvel 2025-03-20 13:46:19 +01:00
parent 5a5742ce60
commit da4dd490d0

View File

@ -216,7 +216,8 @@ func (s *Storage) Tail(jobID, taskID string) (string, error) {
firstNewline := bytes.IndexByte(buffer, byte('\n')) firstNewline := bytes.IndexByte(buffer, byte('\n'))
if 0 <= firstNewline && firstNewline < numBytes-1 { if 0 <= firstNewline && firstNewline < numBytes-1 {
buffer = buffer[firstNewline+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. // The file consists of a single line of text; don't strip the first line.
} }
} }