From ebd3f441464ea9fa2e42f834411562b67f86d1a2 Mon Sep 17 00:00:00 2001 From: Milos Gajdos Date: Fri, 28 Jan 2022 11:19:42 +0000 Subject: [PATCH] Update golangci-lint version and fix reports This commit updates golangci-lint to v1.44.0. It also removes deprecated golint in favour of revive linter. Finally, it addresses an issue reported by linter. Signed-off-by: Milos Gajdos --- .golangci.yml | 2 +- context/http.go | 4 +--- script/setup/install-dev-tools | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 1ba6cb91..c64ba6e7 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -6,7 +6,7 @@ linters: - unconvert - gofmt - goimports - - golint + - revive - ineffassign - vet - unused diff --git a/context/http.go b/context/http.go index 548e4e17..bd3ebd95 100644 --- a/context/http.go +++ b/context/http.go @@ -246,9 +246,7 @@ func (ctx *muxVarsContext) Value(key interface{}) interface{} { return ctx.vars } - if strings.HasPrefix(keyStr, "vars.") { - keyStr = strings.TrimPrefix(keyStr, "vars.") - } + keyStr = strings.TrimPrefix(keyStr, "vars.") if v, ok := ctx.vars[keyStr]; ok { return v diff --git a/script/setup/install-dev-tools b/script/setup/install-dev-tools index 8047bb9d..f848981a 100755 --- a/script/setup/install-dev-tools +++ b/script/setup/install-dev-tools @@ -1,6 +1,6 @@ #!/usr/bin/env bash -GOLANGCI_LINT_VERSION="v1.27.0" +GOLANGCI_LINT_VERSION="v1.44.0" # # Install developer tools to $GOBIN (or $GOPATH/bin if unset)