Skip to content

Commit

Permalink
golangci-lint: remove "SA9003:" exception
Browse files Browse the repository at this point in the history
  • Loading branch information
dsh2dsh committed Nov 18, 2024
1 parent 476b345 commit 0655ae8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
13 changes: 3 additions & 10 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,7 @@ linters-settings:

issues:
exclude-rules:
- path: _test\.go
- path: '_test\.go'
linters:
- errcheck
- wrapcheck
# Disable staticcheck 'Empty body in an if or else branch' as it's useful
# to put a comment into an empty else-clause that explains why whatever
# is done in the if-caluse is not necessary if the condition is false.
- linters:
- staticcheck
text: "SA9003:"

- "errcheck"
- "wrapcheck"
5 changes: 2 additions & 3 deletions internal/config/config_duration.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,9 @@ func parseDuration(e string) (d time.Duration, err error) {
if durationFactor != 0 {
err = errors.New("missing time unit")
return
} else {
// It's the case where user specified '0'.
// We want to allow this, just like time.ParseDuration.
}
// It's the case where user specified '0'. We want to allow this, just like
// time.ParseDuration.
case "s":
durationUnit = time.Second
case "m":
Expand Down

0 comments on commit 0655ae8

Please sign in to comment.