Update golangci-lint to v1.48.0

This commit is contained in:
Kevin Pollet
2022-08-16 16:42:07 +02:00
committed by GitHub
parent dc45a9a1be
commit d8d913afb3
4 changed files with 13 additions and 8 deletions
+4
View File
@@ -37,6 +37,7 @@
[linters] [linters]
enable-all = true enable-all = true
disable = [ disable = [
"ifshort", # Deprecated
"interfacer", # Deprecated "interfacer", # Deprecated
"golint", # Deprecated "golint", # Deprecated
"maligned", # Deprecated "maligned", # Deprecated
@@ -56,6 +57,7 @@
"noctx", # Too strict "noctx", # Too strict
"exhaustive", # Too strict "exhaustive", # Too strict
"exhaustivestruct", # Too strict "exhaustivestruct", # Too strict
"exhaustruct", # Duplicate of exhaustivestruct
"nlreturn", # Too strict "nlreturn", # Too strict
"ireturn", # Not relevant "ireturn", # Not relevant
"varnamelen", # Not relevant "varnamelen", # Not relevant
@@ -63,6 +65,8 @@
"testpackage", # Does not allow testing private funcs "testpackage", # Does not allow testing private funcs
"tparallel", # Not relevant "tparallel", # Not relevant
"paralleltest", # Not relevant "paralleltest", # Not relevant
"forcetypeassert", # Too strict
"nonamedreturns", # Not relevant
"funlen", "funlen",
] ]
+1 -1
View File
@@ -21,7 +21,7 @@ WORKDIR /go/src/github.com/traefik/mesh
RUN curl -sfL https://gist.githubusercontent.com/traefiker/6d7ac019c11d011e4f131bb2cca8900e/raw/goreleaser.sh | sh RUN curl -sfL https://gist.githubusercontent.com/traefiker/6d7ac019c11d011e4f131bb2cca8900e/raw/goreleaser.sh | sh
# Download golangci-lint binary to bin folder in $GOPATH # Download golangci-lint binary to bin folder in $GOPATH
RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $GOPATH/bin v1.43.0 RUN curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $GOPATH/bin v1.48.0
ENV GO111MODULE on ENV GO111MODULE on
COPY go.mod go.sum ./ COPY go.mod go.sum ./
+2 -1
View File
@@ -5,6 +5,7 @@ import (
"encoding/json" "encoding/json"
"fmt" "fmt"
"io" "io"
"net"
"net/http" "net/http"
"time" "time"
@@ -203,7 +204,7 @@ func (a *API) getMeshNodeConfiguration(w http.ResponseWriter, r *http.Request) {
return return
} }
resp, err := http.Get(fmt.Sprintf("http://%s:8080/api/rawdata", pod.Status.PodIP)) resp, err := http.Get(fmt.Sprintf("http://%s/api/rawdata", net.JoinHostPort(pod.Status.PodIP, "8080")))
if err != nil { if err != nil {
a.log.Errorf("Unable to get configuration from pod %q: %v", pod.Name, err) a.log.Errorf("Unable to get configuration from pod %q: %v", pod.Name, err)
http.Error(w, "", http.StatusBadGateway) http.Error(w, "", http.StatusBadGateway)
+6 -6
View File
@@ -23,12 +23,12 @@ type PortFinder interface {
// When multiple Traefik Routers listen to the same entrypoint and have the same Rule, the chosen router is the one // When multiple Traefik Routers listen to the same entrypoint and have the same Rule, the chosen router is the one
// with the highest priority. There are a few cases where this priority is crucial when building the dynamic configuration: // with the highest priority. There are a few cases where this priority is crucial when building the dynamic configuration:
// - When a TrafficSplit is set on a k8s service, 2 Traefik Routers are created. One for accessing the k8s service // - When a TrafficSplit is set on a k8s service, 2 Traefik Routers are created. One for accessing the k8s service
// endpoints and one for accessing the services endpoints mentioned in the TrafficSplit. They both have the same Rule // endpoints and one for accessing the services endpoints mentioned in the TrafficSplit. They both have the same Rule
// but we should always prioritize the TrafficSplit. Therefore, TrafficSplit Routers should always have a higher priority. // but we should always prioritize the TrafficSplit. Therefore, TrafficSplit Routers should always have a higher priority.
// - When a TrafficTarget Destination targets pods of a k8s service and a TrafficSplit is set on this service. This // - When a TrafficTarget Destination targets pods of a k8s service and a TrafficSplit is set on this service. This
// creates 2 Traefik Routers. One for the TrafficSplit and one for the TrafficTarget. We should always prioritize // creates 2 Traefik Routers. One for the TrafficSplit and one for the TrafficTarget. We should always prioritize
// TrafficSplits Routers and TrafficSplit Routers should always have a higher priority than TrafficTarget Routers. // TrafficSplits Routers and TrafficSplit Routers should always have a higher priority than TrafficTarget Routers.
const ( const (
priorityService = iota + 1 priorityService = iota + 1
priorityTrafficTargetDirect priorityTrafficTargetDirect