From 0026196149be41eeb3994dd004982eb73ab95461 Mon Sep 17 00:00:00 2001 From: Prajyot-Parab Date: Tue, 22 Nov 2022 13:46:48 +0530 Subject: [PATCH] Introduce additional linters & bump golangci-lint to 1.50.1 Signed-off-by: Prajyot-Parab --- .github/workflows/golangci-lint.yml | 2 +- .golangci.yml | 5 +++++ cmd/clusterctl/client/repository/goproxy.go | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 1a57ba954276..07db0fea9c48 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -25,5 +25,5 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@0ad9a0988b3973e851ab0a07adf248ec2e100376 # tag=v3.3.1 with: - version: v1.50.0 + version: v1.50.1 working-directory: ${{matrix.working-directory}} diff --git a/.golangci.yml b/.golangci.yml index aa34d6e7a573..02846d820e94 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -17,12 +17,14 @@ linters: - bidichk - bodyclose - containedctx + - decorder - depguard - dogsled - dupword - durationcheck - errcheck - errchkjson + - execinquery - exportloopref - gci - goconst @@ -41,8 +43,10 @@ linters: - nilerr - noctx - nolintlint + - nosprintfhostport - prealloc - predeclared + - reassign - revive - rowserrcheck - staticcheck @@ -52,6 +56,7 @@ linters: - unconvert - unparam - unused + - usestdlibvars - whitespace linters-settings: diff --git a/cmd/clusterctl/client/repository/goproxy.go b/cmd/clusterctl/client/repository/goproxy.go index 08e8e0fc1b4e..7be56e342c20 100644 --- a/cmd/clusterctl/client/repository/goproxy.go +++ b/cmd/clusterctl/client/repository/goproxy.go @@ -74,7 +74,7 @@ func (g *goproxyClient) getVersions(ctx context.Context, base, owner, repository } defer resp.Body.Close() - if resp.StatusCode != 200 { + if resp.StatusCode != http.StatusOK { retryError = errors.Errorf("failed to get versions: response status code %d", resp.StatusCode) return false, nil }