From d03abf3a31c973a5bc2c2dc698fb41b661a0f0c5 Mon Sep 17 00:00:00 2001 From: Ben Kochie Date: Sun, 3 Sep 2023 19:34:37 +0200 Subject: [PATCH] Cleanup golangci-lint errcheck (#1339) Move the errcheck excludes list from an external file to inline in the golangci-lint config file. Signed-off-by: SuperQ --- .golangci.yml | 6 +++++- scripts/errcheck_excludes.txt | 5 ----- 2 files changed, 5 insertions(+), 6 deletions(-) delete mode 100644 scripts/errcheck_excludes.txt diff --git a/.golangci.yml b/.golangci.yml index 075c1e3..8043d57 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -53,7 +53,11 @@ linters-settings: #- pkg: "regexp" # desc: "Use github.com/grafana/regexp instead of regexp" errcheck: - exclude: scripts/errcheck_excludes.txt + exclude-functions: + # The following 2 methods always return nil as the error + - (*github.com/cespare/xxhash/v2.Digest).Write + - (*github.com/cespare/xxhash/v2.Digest).WriteString + - (*bufio.Writer).WriteRune goimports: local-prefixes: github.com/prometheus/client_golang gofumpt: diff --git a/scripts/errcheck_excludes.txt b/scripts/errcheck_excludes.txt deleted file mode 100644 index 64c91af..0000000 --- a/scripts/errcheck_excludes.txt +++ /dev/null @@ -1,5 +0,0 @@ -// The following 2 methods always return nil as the error -(*github.com/cespare/xxhash/v2.Digest).Write -(*github.com/cespare/xxhash/v2.Digest).WriteString - -(*bufio.Writer).WriteRune