chore: update linter

This commit is contained in:
Ludovic Fernandez 2024-03-20 10:26:03 +01:00 committed by GitHub
parent fc875b38e0
commit 141abce2d5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
118 changed files with 10 additions and 265 deletions

View file

@ -7,7 +7,7 @@ on:
env:
GO_VERSION: '1.22'
GOLANGCI_LINT_VERSION: v1.56.2
GOLANGCI_LINT_VERSION: v1.57.0
MISSSPELL_VERSION: v0.4.1
jobs:

View file

@ -1,8 +1,5 @@
run:
timeout: 10m
skip-files: []
skip-dirs:
- pkg/provider/kubernetes/crd/generated/
linters-settings:
govet:
@ -208,11 +205,15 @@ linters:
- maintidx # kind of duplicate of gocyclo
- nonamedreturns # Too strict
- gosmopolitan # not relevant
- exportloopref # Useless with go1.22
- musttag
issues:
exclude-use-default: false
max-issues-per-linter: 0
max-same-issues: 0
exclude-dirs:
- pkg/provider/kubernetes/crd/generated/
exclude:
- 'Error return value of .((os\.)?std(out|err)\..*|.*Close|.*Flush|os\.Remove(All)?|.*printf?|os\.(Un)?Setenv). is not checked'
- "should have a package comment, unless it's in another file for this package"

View file

@ -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.56.2
- curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b "${GOPATH}/bin" v1.57.0
- curl -sSfL https://gist.githubusercontent.com/traefiker/6d7ac019c11d011e4f131bb2cca8900e/raw/goreleaser.sh | bash -s -- -b "${GOPATH}/bin"
- checkout
- cache restore traefik-$(checksum go.sum)

View file

@ -94,7 +94,6 @@ func TestAppendCertMetric(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -1133,8 +1133,6 @@ func (s *HTTPSSuite) TestWithDomainFronting() {
}
for _, test := range testCases {
test := test
req, err := http.NewRequest(http.MethodGet, "https://127.0.0.1:4443", nil)
require.NoError(s.T(), err)
req.Host = test.hostHeader
@ -1178,8 +1176,6 @@ func (s *HTTPSSuite) TestWithInvalidTLSOption() {
}
for _, test := range testCases {
test := test
tlsConfig := &tls.Config{
InsecureSkipVerify: true,
}

View file

@ -42,7 +42,6 @@ func Test_safePrefix(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -91,7 +90,6 @@ func Test_ContentSecurityPolicy(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -210,7 +210,6 @@ func TestHandler_EntryPoints(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -920,7 +920,6 @@ func TestHandler_HTTP(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -275,7 +275,6 @@ func TestHandler_Overview(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -791,7 +791,6 @@ func TestHandler_TCP(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -127,7 +127,6 @@ func TestHandler_RawData(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -252,7 +251,6 @@ func TestHandler_GetMiddleware(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -530,7 +530,6 @@ func TestHandler_UDP(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -65,7 +65,7 @@ func createBody(staticConfiguration *static.Configuration) (*bytes.Buffer, error
}
buf := new(bytes.Buffer)
err = json.NewEncoder(buf).Encode(data) //nolint:musttag // cannot be changed for historical reasons.
err = json.NewEncoder(buf).Encode(data)
if err != nil {
return nil, err
}

View file

@ -244,7 +244,6 @@ func TestDecodeToNode(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -87,7 +87,6 @@ func TestDecode(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -208,7 +208,6 @@ func TestGetRoutersByEntryPoints(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
runtimeConfig := NewConfig(test.conf)

View file

@ -208,7 +208,6 @@ func TestGetTCPRoutersByEntryPoints(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
runtimeConfig := NewConfig(test.conf)

View file

@ -663,8 +663,6 @@ func TestPopulateUsedBy(t *testing.T) {
},
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -189,7 +189,6 @@ func TestGetUDPRoutersByEntryPoints(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
runtimeConfig := NewConfig(test.conf)

View file

@ -26,7 +26,6 @@ func TestHasEntrypoint(t *testing.T) {
}
for _, test := range tests {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -137,9 +137,8 @@ func (hc *HealthCheck) SetBackendsConfiguration(parentCtx context.Context, backe
hc.cancel = cancel
for _, backend := range backends {
currentBackend := backend
safe.Go(func() {
hc.execute(ctx, currentBackend)
hc.execute(ctx, backend)
})
}
}

View file

@ -96,7 +96,6 @@ func TestSetBackendsConfiguration(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -268,7 +267,6 @@ func TestNewRequest(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -358,7 +356,6 @@ func TestRequestOptions(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -36,7 +36,6 @@ func TestIsAuthorized(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -117,7 +116,6 @@ func TestNew(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -289,7 +287,6 @@ func TestContainsIsAllowed(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -21,7 +21,6 @@ func TestRemoteAddrStrategy_GetIP(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -61,7 +60,6 @@ func TestDepthStrategy_GetIP(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -109,7 +107,6 @@ func TestTrustedIPsStrategy_GetIP(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -38,7 +38,6 @@ func TestLog(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
var buffer bytes.Buffer
SetOutput(&buffer)

View file

@ -64,7 +64,6 @@ func TestRegisterPromState(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
actualNbRegistries := 0
for _, prom := range test.prometheusSlice {
@ -419,7 +418,6 @@ func TestPrometheus(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.name, func(t *testing.T) {
family := findMetricFamily(test.name, metricsFamilies)
if family == nil {

View file

@ -86,7 +86,6 @@ func TestCommonLogFormatter_Format(t *testing.T) {
t.Setenv("TZ", "Etc/GMT+9")
for _, test := range testCases {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
@ -150,7 +149,6 @@ func Test_toLog(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -178,7 +178,6 @@ func TestLoggerHeaderFields(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
logFile, err := os.CreateTemp(t.TempDir(), "*.log")
require.NoError(t, err)
@ -466,7 +465,6 @@ func TestLoggerJSON(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -684,7 +682,6 @@ func TestNewLogHandlerOutputStdout(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
// NOTE: It is not possible to run these cases in parallel because we capture Stdout

View file

@ -60,7 +60,6 @@ func TestParseAccessLog(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -28,8 +28,6 @@ func TestSaveRetries(t *testing.T) {
}
for _, test := range tests {
test := test
t.Run(fmt.Sprintf("%d retries", test.requestAttempt), func(t *testing.T) {
t.Parallel()
saveRetries := &SaveRetries{}

View file

@ -29,7 +29,6 @@ func TestNewAddPrefix(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -75,7 +74,6 @@ func TestAddPrefix(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -210,7 +210,6 @@ func TestBasicAuthUsersFromFile(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -88,7 +88,6 @@ func TestDigestAuthUsersFromFile(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -48,7 +48,6 @@ func TestBuffering(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -217,7 +217,6 @@ func TestCloseNotifier(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -124,7 +124,6 @@ func TestShouldNotCompressWhenSpecificContentType(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -326,8 +325,6 @@ func TestMinResponseBodyBytes(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()

View file

@ -47,7 +47,6 @@ func TestRemover(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -157,7 +157,6 @@ func TestHandler(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -293,7 +292,6 @@ func TestNewResponseRecorder(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -28,7 +28,6 @@ func TestEmptyBackendHandler(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(fmt.Sprintf("amount servers %d", test.amountServer), func(t *testing.T) {
t.Parallel()

View file

@ -272,7 +272,6 @@ func TestServeHTTP(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -369,7 +368,6 @@ func Test_isWebsocketRequest(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -52,7 +52,6 @@ func TestNewHeader_customRequestHeader(t *testing.T) {
emptyHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {})
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -59,7 +59,6 @@ func TestNew_allowedHosts(t *testing.T) {
require.NoError(t, err)
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -180,7 +180,6 @@ func Test_newSecure_modifyResponse(t *testing.T) {
emptyHandler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { w.WriteHeader(http.StatusOK) })
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -33,7 +33,6 @@ func TestNewIPAllowLister(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -76,7 +75,6 @@ func TestIPAllowLister_ServeHTTP(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -33,7 +33,6 @@ func TestNewIPWhiteLister(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -76,7 +75,6 @@ func TestIPWhiteLister_ServeHTTP(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -86,7 +86,6 @@ func TestCloseNotifier(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -120,7 +119,6 @@ func Test_getMethod(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.method, func(t *testing.T) {
t.Parallel()

View file

@ -310,7 +310,6 @@ func TestPassTLSClientCert_PEM(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -533,7 +532,6 @@ func TestPassTLSClientCert_certInfo(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -604,7 +602,6 @@ WqeUSNGYV//RunTeuRDAf5OxehERb1srzBXhRZ3cZdzXbgR/`,
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -645,7 +642,6 @@ func Test_getSANs(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -54,7 +54,6 @@ func TestNew(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -89,7 +89,6 @@ func TestNewRateLimiter(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -248,7 +247,6 @@ func TestRateLimit(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
if test.loadDuration >= time.Minute && testing.Short() {
t.Skip("skipping test in short mode.")

View file

@ -154,7 +154,6 @@ func TestRedirectRegexHandler(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -283,8 +283,6 @@ func TestRedirectSchemeHandler(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -35,7 +35,6 @@ func TestCNAMEFlatten(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -38,7 +38,6 @@ func TestRequestHost(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -80,7 +79,6 @@ func TestRequestFlattening(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -173,7 +171,6 @@ func Test_parseHost(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -101,7 +101,6 @@ func TestRetry(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -272,7 +271,6 @@ func TestRetryWebsocket(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -37,7 +37,6 @@ func TestSNICheck_ServeHTTP(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -178,7 +178,6 @@ func TestStripPrefix(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -108,7 +108,6 @@ func TestStripPrefixRegex(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.path, func(t *testing.T) {
t.Parallel()

View file

@ -39,7 +39,6 @@ func TestNewIPAllowLister(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -81,7 +80,6 @@ func TestIPAllowLister_ServeHTTP(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -39,7 +39,6 @@ func TestNewIPWhiteLister(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -81,7 +80,6 @@ func TestIPWhiteLister_ServeHTTP(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -653,8 +653,6 @@ func Test_addRoute(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -808,14 +806,12 @@ func Test_addRoutePriority(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
muxer, err := NewMuxer()
require.NoError(t, err)
for _, route := range test.cases {
route := route
handler := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("X-From", route.xFrom)
})
@ -900,7 +896,6 @@ func TestHostRegexp(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -964,7 +959,6 @@ func TestParseDomains(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.expression, func(t *testing.T) {
t.Parallel()
@ -1027,7 +1021,6 @@ func TestAbsoluteFormURL(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -502,8 +502,6 @@ func Test_addTCPRoute(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -614,7 +612,6 @@ func TestParseHostSNI(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.expression, func(t *testing.T) {
t.Parallel()
@ -659,8 +656,6 @@ func Test_HostSNICatchAll(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -761,8 +756,6 @@ func Test_HostSNI(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -876,8 +869,6 @@ func Test_HostSNIRegexp(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -969,8 +960,6 @@ func Test_ClientIP(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -1038,8 +1027,6 @@ func Test_ALPN(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -1107,8 +1094,6 @@ func Test_Priority(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -1117,7 +1102,6 @@ func Test_Priority(t *testing.T) {
matchedRule := ""
for rule, priority := range test.rules {
rule := rule
err := muxer.AddRoute(rule, priority, tcp.HandlerFunc(func(conn tcp.WriteCloser) {
matchedRule = rule
}))

View file

@ -44,7 +44,6 @@ func TestLocalStore_GetAccount(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
s := NewLocalStore(test.filename)

View file

@ -166,7 +166,6 @@ func TestGetUncheckedCertificates(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -241,7 +240,6 @@ func TestProvider_sanitizeDomains(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -423,7 +421,6 @@ func TestDeleteUnnecessaryDomains(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -497,7 +494,6 @@ func TestIsAccountMatchingCaServer(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -573,7 +569,6 @@ func TestInitAccount(t *testing.T) {
},
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -632,7 +627,6 @@ func Test_getCertificateRenewDurations(t *testing.T) {
},
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -183,7 +183,6 @@ func (p ProviderAggregator) Provide(configurationChan chan<- dynamic.Message, po
}
for _, prd := range p.providers {
prd := prd
safe.Go(func() {
p.launchProvider(configurationChan, pool, prd)
})

View file

@ -188,7 +188,6 @@ func TestMatchLabels(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.expr, func(t *testing.T) {
t.Parallel()

View file

@ -95,7 +95,6 @@ func TestMatchTags(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.expr, func(t *testing.T) {
t.Parallel()

View file

@ -276,7 +276,6 @@ func TestDefaultRule(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -3161,8 +3160,6 @@ func Test_buildConfiguration(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -3232,8 +3229,6 @@ func TestNamespaces(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -52,7 +52,6 @@ func Test_tagsToNeutralLabels(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -369,7 +369,6 @@ func TestDefaultRule(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -3484,8 +3483,6 @@ func Test_buildConfiguration(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -3668,7 +3665,6 @@ func TestDockerGetIPPort(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -3745,7 +3741,6 @@ func TestDockerGetPort(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -3847,7 +3842,6 @@ func TestDockerGetIPAddress(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -3915,7 +3909,6 @@ func TestSwarmGetIPAddress(t *testing.T) {
}
for serviceID, test := range testCases {
test := test
t.Run(strconv.Itoa(serviceID), func(t *testing.T) {
t.Parallel()
@ -3950,7 +3943,6 @@ func TestSwarmGetPort(t *testing.T) {
}
for serviceID, test := range testCases {
test := test
t.Run(strconv.Itoa(serviceID), func(t *testing.T) {
t.Parallel()

View file

@ -456,8 +456,7 @@ func (p *Provider) listServices(ctx context.Context, dockerClient client.APIClie
networkMap := make(map[string]*dockertypes.NetworkResource)
for _, network := range networkList {
networkToAdd := network
networkMap[network.ID] = &networkToAdd
networkMap[network.ID] = &network
}
var dockerDataList []dockerData

View file

@ -79,7 +79,6 @@ func TestListTasks(t *testing.T) {
}
for caseID, test := range testCases {
test := test
t.Run(strconv.Itoa(caseID), func(t *testing.T) {
t.Parallel()
@ -271,7 +270,6 @@ func TestListServices(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -392,7 +390,6 @@ func TestSwarmTaskParsing(t *testing.T) {
}
for caseID, test := range testCases {
test := test
t.Run(strconv.Itoa(caseID), func(t *testing.T) {
t.Parallel()

View file

@ -340,7 +340,6 @@ func TestDefaultRule(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -3071,8 +3070,6 @@ func Test_buildConfiguration(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -68,7 +68,6 @@ func TestChunkIDs(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -1422,8 +1422,6 @@ func TestLoadIngressRouteTCPs(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -4169,7 +4167,6 @@ func TestLoadIngressRoutes(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -4650,8 +4647,6 @@ func TestLoadIngressRouteUDPs(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -4727,8 +4722,6 @@ func TestParseServiceProtocol(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -4959,7 +4952,6 @@ func TestGetServicePort(t *testing.T) {
},
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -5931,8 +5923,6 @@ func TestCrossNamespace(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -6226,8 +6216,6 @@ func TestExternalNameService(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -6434,8 +6422,6 @@ func TestNativeLB(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -233,8 +233,6 @@ func TestStatusEquals(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -1471,7 +1471,6 @@ func TestLoadHTTPRoutes(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -2206,7 +2205,6 @@ func TestLoadTCPRoutes(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -3299,7 +3297,6 @@ func TestLoadTLSRoutes(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -4251,7 +4248,6 @@ func TestLoadMixedRoutes(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -4361,7 +4357,6 @@ func Test_hostRule(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
rule, err := hostRule(test.hostnames)
@ -4592,7 +4587,6 @@ func Test_extractRule(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -4657,7 +4651,6 @@ func Test_hostSNIRule(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -4978,7 +4971,6 @@ func Test_shouldAttach(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -5082,7 +5074,6 @@ func Test_matchingHostnames(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -5194,7 +5185,6 @@ func Test_getAllowedRoutes(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -5240,7 +5230,6 @@ func Test_makeListenerKey(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -80,7 +80,6 @@ func Test_parseRouterConfig(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -155,7 +154,6 @@ func Test_parseServiceConfig(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -239,7 +237,6 @@ func Test_convertAnnotations(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -47,7 +47,6 @@ func TestTranslateNotFoundError(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -125,7 +124,6 @@ func TestIsLoadBalancerIngressEquals(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -1602,8 +1602,6 @@ func TestLoadConfigurationFromIngresses(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -1748,8 +1746,6 @@ func TestLoadConfigurationFromIngressesWithExternalNameServices(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -1828,8 +1824,6 @@ func TestLoadConfigurationFromIngressesWithNativeLB(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -2031,7 +2025,6 @@ func TestGetCertificates(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -507,7 +507,6 @@ func Test_detectChanges(t *testing.T) {
},
}
for _, test := range tests {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()

View file

@ -35,8 +35,6 @@ func TestNamespaces(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -121,8 +121,7 @@ func readinessCheckResult(taskID string, ready bool) func(*marathon.Application)
func withTasks(tasks ...marathon.Task) func(*marathon.Application) {
return func(application *marathon.Application) {
for _, task := range tasks {
tu := task
application.Tasks = append(application.Tasks, &tu)
application.Tasks = append(application.Tasks, &task)
}
}
}

View file

@ -2035,7 +2035,6 @@ func TestBuildConfiguration(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -2089,7 +2088,6 @@ func TestApplicationFilterEnabled(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -2492,7 +2490,6 @@ func TestGetServer(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -123,7 +123,6 @@ func TestGetConfiguration(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -115,7 +115,6 @@ func TestEnabledReadinessChecker(t *testing.T) {
}
for _, test := range tests {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
rc := testReadinessChecker()

View file

@ -2765,8 +2765,6 @@ func TestNamespaces(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -118,7 +118,6 @@ func TestProvider_SetDefaults_Endpoint(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
for k, v := range test.envs {
t.Setenv(k, v)

View file

@ -97,7 +97,6 @@ func Test_tagsToLabels(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -1262,8 +1262,6 @@ func Test_buildConfiguration(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -257,7 +257,6 @@ func Test_createConfiguration(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -59,7 +59,6 @@ func Test_doOnJSON_simple(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
output := doOnJSON(test.input)

View file

@ -369,7 +369,6 @@ func Test_doOnStruct(t *testing.T) {
}
for _, test := range testCase {
test := test
t.Run(test.name, func(t *testing.T) {
t.Parallel()
val := reflect.ValueOf(test.base).Elem()

View file

@ -31,7 +31,6 @@ func NewParser(matchers []string) (predicate.Parser, error) {
parserFuncs := make(map[string]interface{})
for _, matcherName := range matchers {
matcherName := matcherName
fn := func(value ...string) TreeBuilder {
return func() *Tree {
return &Tree{

View file

@ -250,8 +250,6 @@ func TestRuleMatch(t *testing.T) {
require.NoError(t, err)
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -63,7 +63,6 @@ func TestPoolWithCtx(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
// These subtests cannot be run in parallel, since the testRoutine
// is shared across the subtests.

View file

@ -113,7 +113,6 @@ func Test_mergeConfiguration(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -162,7 +161,6 @@ func Test_mergeConfiguration_tlsCertificates(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -346,8 +344,6 @@ func Test_mergeConfiguration_tlsOptions(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -439,7 +435,6 @@ func Test_mergeConfiguration_tlsStore(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -662,7 +657,6 @@ func Test_applyModel(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -34,7 +34,6 @@ func TestGetName(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -64,7 +63,6 @@ func Test_sanitizeName(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -256,7 +256,6 @@ func TestBuilder_BuildChainWithContext(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -364,7 +363,6 @@ func TestBuilder_buildConstructor(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -47,7 +47,6 @@ func TestAddInContext(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()
@ -103,7 +102,6 @@ func TestGetQualifiedName(t *testing.T) {
}
for _, test := range testCases {
test := test
t.Run(test.desc, func(t *testing.T) {
t.Parallel()

View file

@ -67,7 +67,6 @@ func (m *Manager) BuildHandlers(rootCtx context.Context, entryPoints []string, t
entryPointHandlers := make(map[string]http.Handler)
for entryPointName, routers := range m.getHTTPRouters(rootCtx, entryPoints, tls) {
entryPointName := entryPointName
ctx := log.With(rootCtx, log.Str(log.EntryPointName, entryPointName))
handler, err := m.buildEntryPointHandler(ctx, routers)

Some files were not shown because too many files have changed in this diff Show more