diff --git a/.github/workflows/validate.yaml b/.github/workflows/validate.yaml index 15db3ed12..21aa83767 100644 --- a/.github/workflows/validate.yaml +++ b/.github/workflows/validate.yaml @@ -7,7 +7,7 @@ on: env: GO_VERSION: 1.17 - GOLANGCI_LINT_VERSION: v1.45.0 + GOLANGCI_LINT_VERSION: v1.46.2 MISSSPELL_VERSION: v0.3.4 IN_DOCKER: "" diff --git a/.golangci.toml b/.golangci.toml index ae9b717c8..35b5cca21 100644 --- a/.golangci.toml +++ b/.golangci.toml @@ -119,6 +119,7 @@ "interfacer", # Deprecated "maligned", # Deprecated "golint", # Deprecated + "execinquery", # Not relevant (SQL) "sqlclosecheck", # Not relevant (SQL) "rowserrcheck", # Not relevant (SQL) "lll", # Not relevant @@ -142,6 +143,7 @@ "paralleltest", # Not relevant "exhaustive", # Not relevant "exhaustivestruct", # Not relevant + "exhaustruct", # duplicate of exhaustivestruct "goerr113", # Too strict "wrapcheck", # Too strict "noctx", # Too strict @@ -156,6 +158,7 @@ "contextcheck", # too many false-positive "containedctx", # too many false-positive "maintidx", # kind of duplicate of gocyclo + "nonamedreturns", # not relevant ] [issues] diff --git a/.semaphore/semaphore.yml b/.semaphore/semaphore.yml index 593d162b9..ce527292b 100644 --- a/.semaphore/semaphore.yml +++ b/.semaphore/semaphore.yml @@ -25,7 +25,7 @@ global_job_config: - export "PATH=${GOPATH}/bin:${PATH}" - mkdir -vp "${SEMAPHORE_GIT_DIR}" "${GOPATH}/bin" - export GOPROXY=https://proxy.golang.org,direct - - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "${GOPATH}/bin" v1.45.0 + - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "${GOPATH}/bin" v1.46.2 - curl -sSfL https://gist.githubusercontent.com/traefiker/6d7ac019c11d011e4f131bb2cca8900e/raw/goreleaser.sh | bash -s -- -b "${GOPATH}/bin" - checkout - cache restore traefik-$(checksum go.sum) diff --git a/build.Dockerfile b/build.Dockerfile index 4424e3603..8d3159c8e 100644 --- a/build.Dockerfile +++ b/build.Dockerfile @@ -13,7 +13,7 @@ RUN mkdir -p /usr/local/bin \ | tar -xzC /usr/local/bin --transform 's#^.+/##x' # Download golangci-lint binary to bin folder in $GOPATH -RUN curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- -b $GOPATH/bin v1.45.0 +RUN curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- -b $GOPATH/bin v1.46.2 # Download misspell binary to bin folder in $GOPATH RUN curl -sfL https://raw.githubusercontent.com/client9/misspell/master/install-misspell.sh | bash -s -- -b $GOPATH/bin v0.3.4 diff --git a/integration/https_test.go b/integration/https_test.go index b10eb37f2..6ddda5e8e 100644 --- a/integration/https_test.go +++ b/integration/https_test.go @@ -1072,7 +1072,7 @@ func (s *HTTPSSuite) TestEntryPointHttpsRedirectAndPathModification(c *check.C) resp.Body.Close() location := resp.Header.Get("Location") - expected := fmt.Sprintf("https://%s:8443%s", host, test.path) + expected := "https://" + net.JoinHostPort(host, "8443") + test.path c.Assert(location, checker.Equals, expected) } diff --git a/integration/timeout_test.go b/integration/timeout_test.go index b5a68e7e9..68c5886ca 100644 --- a/integration/timeout_test.go +++ b/integration/timeout_test.go @@ -2,6 +2,7 @@ package integration import ( "fmt" + "net" "net/http" "os" "time" @@ -38,7 +39,8 @@ func (s *TimeoutSuite) TestForwardingTimeouts(c *check.C) { c.Assert(response.StatusCode, checker.Equals, http.StatusGatewayTimeout) // Check that timeout service is available - statusURL := fmt.Sprintf("http://%s:9000/statusTest?status=200", timeoutEndpointIP) + statusURL := fmt.Sprintf("http://%s/statusTest?status=200", + net.JoinHostPort(timeoutEndpointIP, "9000")) c.Assert(try.GetRequest(statusURL, 60*time.Second, try.StatusCodeIs(http.StatusOK)), checker.IsNil) // This simulates a ResponseHeaderTimeout.