diff --git a/.golangci.toml b/.golangci.toml index bc2f36238..6c7e4db25 100644 --- a/.golangci.toml +++ b/.golangci.toml @@ -182,35 +182,14 @@ ] [[issues.exclude-rules]] path = "(.+)_test.go" - linters = ["goconst", "funlen", "godot", "nosnakecase"] + linters = ["goconst", "funlen", "godot"] [[issues.exclude-rules]] path = "(.+)_test.go" text = " always receives " linters = [ "unparam" ] - [[issues.exclude-rules]] - path = "integration/.+_test.go" - text = "Error return value of `cmd\\.Process\\.Kill` is not checked" - [[issues.exclude-rules]] - path = "integration/(consul_catalog_test|constraint_test).go" - text = "Error return value of `(s.deregisterService|s.deregisterAgentService)` is not checked" - [[issues.exclude-rules]] - path = "integration/grpc_test.go" - text = "Error return value of `closer` is not checked" - [[issues.exclude-rules]] - path = "pkg/h2c/h2c.go" - text = "Error return value of `rw.Write` is not checked" - [[issues.exclude-rules]] - path = "pkg/provider/docker/builder_test.go" - text = "(U1000: func )?`(.+)` is unused" - [[issues.exclude-rules]] - path = "pkg/provider/kubernetes/builder_(endpoint|service)_test.go" - text = "(U1000: func )?`(.+)` is unused" [[issues.exclude-rules]] path = "pkg/server/service/bufferpool.go" text = "SA6002: argument should be pointer-like to avoid allocations" - [[issues.exclude-rules]] - path = "cmd/configuration.go" - text = "string `traefik` has (\\d) occurrences, make it a constant" [[issues.exclude-rules]] path = "pkg/server/middleware/middlewares.go" text = "Function 'buildConstructor' has too many statements" @@ -220,9 +199,6 @@ [[issues.exclude-rules]] path = "pkg/tracing/tracing.go" text = "printf-like formatting function 'SetErrorWithEvent' should be named 'SetErrorWithEventf'" - [[issues.exclude-rules]] - path = "pkg/log/deprecated.go" - linters = ["godot"] [[issues.exclude-rules]] path = "(.+)\\.go" text = "struct-tag: unknown option 'inline' in JSON tag" @@ -241,13 +217,3 @@ [[issues.exclude-rules]] path = "pkg/metrics/metrics.go" linters = ["interfacebloat"] - [[issues.exclude-rules]] - path = "pkg/provider/acme/provider.go" - text = "\\(\\*Provider\\)\\.resolveCertificate - result 0 \\(\\*github.com/go-acme/lego/v4/certificate.Resource\\) is never used" - [[issues.exclude-rules]] - path = "integration/healthcheck_test.go" - text = "Duplicate words \\(wsp2,\\) found" - [[issues.exclude-rules]] - path = "pkg/types/domain_test.go" - text = "Duplicate words \\(sub\\) found" - diff --git a/pkg/log/deprecated.go b/pkg/log/deprecated.go index 12bb51176..3bde3f841 100644 --- a/pkg/log/deprecated.go +++ b/pkg/log/deprecated.go @@ -9,67 +9,67 @@ import ( ) // Debug logs a message at level Debug on the standard logger. -// Deprecated +// Deprecated: use log.FromContext(ctx).Debug(...) instead. func Debug(args ...interface{}) { mainLogger.Debug(args...) } // Debugf logs a message at level Debug on the standard logger. -// Deprecated +// Deprecated: use log.FromContext(ctx).Debugf(...) instead. func Debugf(format string, args ...interface{}) { mainLogger.Debugf(format, args...) } // Info logs a message at level Info on the standard logger. -// Deprecated +// Deprecated: use log.FromContext(ctx).Info(...) instead. func Info(args ...interface{}) { mainLogger.Info(args...) } // Infof logs a message at level Info on the standard logger. -// Deprecated +// Deprecated: use log.FromContext(ctx).Infof(...) instead. func Infof(format string, args ...interface{}) { mainLogger.Infof(format, args...) } // Warn logs a message at level Warn on the standard logger. -// Deprecated +// Deprecated: use log.FromContext(ctx).Warn(...) instead. func Warn(args ...interface{}) { mainLogger.Warn(args...) } // Warnf logs a message at level Warn on the standard logger. -// Deprecated +// Deprecated: use log.FromContext(ctx).Warnf(...) instead. func Warnf(format string, args ...interface{}) { mainLogger.Warnf(format, args...) } // Error logs a message at level Error on the standard logger. -// Deprecated +// Deprecated: use log.FromContext(ctx).Error(...) instead. func Error(args ...interface{}) { mainLogger.Error(args...) } // Errorf logs a message at level Error on the standard logger. -// Deprecated +// Deprecated: use log.FromContext(ctx).Errorf(...) instead. func Errorf(format string, args ...interface{}) { mainLogger.Errorf(format, args...) } // Panic logs a message at level Panic on the standard logger. -// Deprecated +// Deprecated: use log.FromContext(ctx).Panic(...) instead. func Panic(args ...interface{}) { mainLogger.Panic(args...) } // Fatal logs a message at level Fatal on the standard logger. -// Deprecated +// Deprecated: use log.FromContext(ctx).Fatal(...) instead. func Fatal(args ...interface{}) { mainLogger.Fatal(args...) } // Fatalf logs a message at level Fatal on the standard logger. -// Deprecated +// Deprecated: use log.FromContext(ctx).Fatalf(...) instead. func Fatalf(format string, args ...interface{}) { mainLogger.Fatalf(format, args...) } diff --git a/pkg/provider/docker/builder_test.go b/pkg/provider/docker/builder_test.go index 424dc7a3e..b952fdce3 100644 --- a/pkg/provider/docker/builder_test.go +++ b/pkg/provider/docker/builder_test.go @@ -47,12 +47,6 @@ func nodeIP(ip string) func(*docker.ContainerJSON) { } } -func labels(labels map[string]string) func(*docker.ContainerJSON) { - return func(c *docker.ContainerJSON) { - c.Config.Labels = labels - } -} - func ports(portMap nat.PortMap) func(*docker.ContainerJSON) { return func(c *docker.ContainerJSON) { c.NetworkSettings.NetworkSettingsBase.Ports = portMap