Skip to content

Commit

Permalink
Cleanup golangci-lint errcheck (#129)
Browse files Browse the repository at this point in the history
Move the errcheck excludes list from an external file to inline in the golangci-lint config file.

Signed-off-by: SuperQ <[email protected]>
  • Loading branch information
SuperQ authored Sep 2, 2023
1 parent e3e31ff commit 38b72b3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 14 deletions.
13 changes: 12 additions & 1 deletion .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,17 @@ linters-settings:
- io/ioutil: "Use corresponding 'os' or 'io' functions instead."
- regexp: "Use github.com/grafana/regexp instead of regexp"
errcheck:
exclude: scripts/errcheck_excludes.txt
exclude-functions:
# Don't flag lines such as "io.Copy(io.Discard, resp.Body)".
- io.Copy
# The next two are used in HTTP handlers, any error is handled by the server itself.
- io.WriteString
- (net/http.ResponseWriter).Write
# No need to check for errors on server's shutdown.
- (*net/http.Server).Shutdown
# Never check for logger errors.
- (github.com/go-kit/log.Logger).Log
# Never check for rollback errors as Rollback() is called when a previous error was detected.
- (github.com/prometheus/prometheus/storage.Appender).Rollback
goimports:
local-prefixes: github.com/prometheus/promlens
13 changes: 0 additions & 13 deletions scripts/errcheck_excludes.txt

This file was deleted.

0 comments on commit 38b72b3

Please sign in to comment.