From efa0f7b50a317388fb90380b87ee984ff40ea9f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Nussbaumer?= Date: Tue, 12 Dec 2023 15:57:32 +0100 Subject: [PATCH] chore: fix linting errors and update golangci-lint config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Clément Nussbaumer --- .golangci.yml | 8 ++------ internal/servicecheck/servicecheck.go | 2 +- internal/servicecheck/transport.go | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index ada0007f..55314a8a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -42,13 +42,10 @@ linters-settings: - gocognit - funlen - gocyclo - linters: disable-all: true enable: - bodyclose - - deadcode - - depguard - dogsled - dupl - errcheck @@ -71,19 +68,18 @@ linters: - misspell - nakedret - prealloc + - protogetter - rowserrcheck - exportloopref - staticcheck - - structcheck - stylecheck + - sqlclosecheck - typecheck - unconvert - unparam - unused - - varcheck - whitespace - wsl -issues: exclude: # Very commonly not checked. - 'Error return value of .(l.Sync|.*Close|.*.Write|.*Flush|os\.Remove(All)?|os\.(Un)?Setenv). is not checked' diff --git a/internal/servicecheck/servicecheck.go b/internal/servicecheck/servicecheck.go index b285553c..5293a2ec 100644 --- a/internal/servicecheck/servicecheck.go +++ b/internal/servicecheck/servicecheck.go @@ -170,7 +170,7 @@ func (c *Checker) MeIngress() (string, error) { return skippedStr, nil } - return c.doRequest(c.KubenurseIngressURL + "/alwayshappy") + return c.doRequest(c.KubenurseIngressURL + "/alwayshappy") //nolint:goconst // readability } // MeService checks if the kubenurse is reachable at the /alwayshappy endpoint through the kubernetes service diff --git a/internal/servicecheck/transport.go b/internal/servicecheck/transport.go index cc665ee5..9bf8ef19 100644 --- a/internal/servicecheck/transport.go +++ b/internal/servicecheck/transport.go @@ -66,7 +66,7 @@ func generateRoundTripper(extraCA string, insecure bool) (http.RoundTripper, err // Append extra CA, if set if extraCA != "" { - caCert, err := os.ReadFile(extraCA) //nolint:gosec // Intentionally included by the user. + caCert, err := os.ReadFile(extraCA) // Intentionally included by the user. if err != nil { return nil, fmt.Errorf("could not load certificate %s: %w", extraCA, err) }