Update linter
This commit is contained in:
parent
b361608693
commit
7751fb24eb
18 changed files with 63 additions and 51 deletions
2
.github/workflows/validate.yaml
vendored
2
.github/workflows/validate.yaml
vendored
|
@ -7,7 +7,7 @@ on:
|
||||||
|
|
||||||
env:
|
env:
|
||||||
GO_VERSION: 1.17
|
GO_VERSION: 1.17
|
||||||
GOLANGCI_LINT_VERSION: v1.46.2
|
GOLANGCI_LINT_VERSION: v1.47.1
|
||||||
MISSSPELL_VERSION: v0.3.4
|
MISSSPELL_VERSION: v0.3.4
|
||||||
IN_DOCKER: ""
|
IN_DOCKER: ""
|
||||||
|
|
||||||
|
|
|
@ -179,7 +179,7 @@
|
||||||
]
|
]
|
||||||
[[issues.exclude-rules]]
|
[[issues.exclude-rules]]
|
||||||
path = "(.+)_test.go"
|
path = "(.+)_test.go"
|
||||||
linters = ["goconst", "funlen", "godot"]
|
linters = ["goconst", "funlen", "godot", "nosnakecase"]
|
||||||
[[issues.exclude-rules]]
|
[[issues.exclude-rules]]
|
||||||
path = "integration/.+_test.go"
|
path = "integration/.+_test.go"
|
||||||
text = "Error return value of `cmd\\.Process\\.Kill` is not checked"
|
text = "Error return value of `cmd\\.Process\\.Kill` is not checked"
|
||||||
|
@ -222,3 +222,15 @@
|
||||||
[[issues.exclude-rules]]
|
[[issues.exclude-rules]]
|
||||||
path = "pkg/server/router/tcp/manager.go"
|
path = "pkg/server/router/tcp/manager.go"
|
||||||
text = "Function 'buildEntryPointHandler' is too long (.+)"
|
text = "Function 'buildEntryPointHandler' is too long (.+)"
|
||||||
|
[[issues.exclude-rules]]
|
||||||
|
path = "integration/fake_dns_server.go"
|
||||||
|
linters = ["nosnakecase"]
|
||||||
|
[[issues.exclude-rules]]
|
||||||
|
path = "pkg/plugins/providers.go"
|
||||||
|
linters = ["nosnakecase"]
|
||||||
|
[[issues.exclude-rules]]
|
||||||
|
path = "pkg/tls/cipher.go"
|
||||||
|
linters = ["nosnakecase"]
|
||||||
|
[[issues.exclude-rules]]
|
||||||
|
text = "O_WRONLY|O_RDWR|O_CREATE|O_TRUNC|O_APPEND"
|
||||||
|
linters = ["nosnakecase"]
|
||||||
|
|
|
@ -13,7 +13,7 @@ RUN mkdir -p /usr/local/bin \
|
||||||
| tar -xzC /usr/local/bin --transform 's#^.+/##x'
|
| tar -xzC /usr/local/bin --transform 's#^.+/##x'
|
||||||
|
|
||||||
# Download golangci-lint binary to bin folder in $GOPATH
|
# 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.46.2
|
RUN curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | bash -s -- -b $GOPATH/bin v1.47.1
|
||||||
|
|
||||||
# Download misspell binary to bin folder in $GOPATH
|
# 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
|
RUN curl -sfL https://raw.githubusercontent.com/client9/misspell/master/install-misspell.sh | bash -s -- -b $GOPATH/bin v0.3.4
|
||||||
|
|
|
@ -1904,8 +1904,8 @@ spec:
|
||||||
schema:
|
schema:
|
||||||
openAPIV3Schema:
|
openAPIV3Schema:
|
||||||
description: 'TraefikService is the CRD implementation of a Traefik Service.
|
description: 'TraefikService is the CRD implementation of a Traefik Service.
|
||||||
TraefikService object allows to: - Apply weight to Services on load-balancing -
|
TraefikService object allows to: - Apply weight to Services on load-balancing
|
||||||
Mirror traffic on services More info: https://doc.traefik.io/traefik/v2.8/routing/providers/kubernetes-crd/#kind-traefikservice'
|
- Mirror traffic on services More info: https://doc.traefik.io/traefik/v2.8/routing/providers/kubernetes-crd/#kind-traefikservice'
|
||||||
properties:
|
properties:
|
||||||
apiVersion:
|
apiVersion:
|
||||||
description: 'APIVersion defines the versioned schema of this representation
|
description: 'APIVersion defines the versioned schema of this representation
|
||||||
|
|
|
@ -20,8 +20,8 @@ spec:
|
||||||
schema:
|
schema:
|
||||||
openAPIV3Schema:
|
openAPIV3Schema:
|
||||||
description: 'TraefikService is the CRD implementation of a Traefik Service.
|
description: 'TraefikService is the CRD implementation of a Traefik Service.
|
||||||
TraefikService object allows to: - Apply weight to Services on load-balancing -
|
TraefikService object allows to: - Apply weight to Services on load-balancing
|
||||||
Mirror traffic on services More info: https://doc.traefik.io/traefik/v2.8/routing/providers/kubernetes-crd/#kind-traefikservice'
|
- Mirror traffic on services More info: https://doc.traefik.io/traefik/v2.8/routing/providers/kubernetes-crd/#kind-traefikservice'
|
||||||
properties:
|
properties:
|
||||||
apiVersion:
|
apiVersion:
|
||||||
description: 'APIVersion defines the versioned schema of this representation
|
description: 'APIVersion defines the versioned schema of this representation
|
||||||
|
|
BIN
golangci-lint
Executable file
BIN
golangci-lint
Executable file
Binary file not shown.
|
@ -1904,8 +1904,8 @@ spec:
|
||||||
schema:
|
schema:
|
||||||
openAPIV3Schema:
|
openAPIV3Schema:
|
||||||
description: 'TraefikService is the CRD implementation of a Traefik Service.
|
description: 'TraefikService is the CRD implementation of a Traefik Service.
|
||||||
TraefikService object allows to: - Apply weight to Services on load-balancing -
|
TraefikService object allows to: - Apply weight to Services on load-balancing
|
||||||
Mirror traffic on services More info: https://doc.traefik.io/traefik/v2.8/routing/providers/kubernetes-crd/#kind-traefikservice'
|
- Mirror traffic on services More info: https://doc.traefik.io/traefik/v2.8/routing/providers/kubernetes-crd/#kind-traefikservice'
|
||||||
properties:
|
properties:
|
||||||
apiVersion:
|
apiVersion:
|
||||||
description: 'APIVersion defines the versioned schema of this representation
|
description: 'APIVersion defines the versioned schema of this representation
|
||||||
|
|
|
@ -53,7 +53,7 @@ func RegisterDatadog(ctx context.Context, config *types.Datadog) Registry {
|
||||||
}
|
}
|
||||||
|
|
||||||
datadogClient = dogstatsd.New(config.Prefix+".", kitlog.LoggerFunc(func(keyvals ...interface{}) error {
|
datadogClient = dogstatsd.New(config.Prefix+".", kitlog.LoggerFunc(func(keyvals ...interface{}) error {
|
||||||
log.WithoutContext().WithField(log.MetricsProviderName, "datadog").Info(keyvals)
|
log.WithoutContext().WithField(log.MetricsProviderName, "datadog").Info(keyvals...)
|
||||||
return nil
|
return nil
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
|
@ -136,7 +136,7 @@ func initInfluxDBClient(ctx context.Context, config *types.InfluxDB) *influx.Inf
|
||||||
RetentionPolicy: config.RetentionPolicy,
|
RetentionPolicy: config.RetentionPolicy,
|
||||||
},
|
},
|
||||||
kitlog.LoggerFunc(func(keyvals ...interface{}) error {
|
kitlog.LoggerFunc(func(keyvals ...interface{}) error {
|
||||||
log.WithoutContext().WithField(log.MetricsProviderName, "influxdb").Info(keyvals)
|
log.WithoutContext().WithField(log.MetricsProviderName, "influxdb").Info(keyvals...)
|
||||||
return nil
|
return nil
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ func RegisterInfluxDB2(ctx context.Context, config *types.InfluxDB2) Registry {
|
||||||
config.AdditionalLabels,
|
config.AdditionalLabels,
|
||||||
influxdb.BatchPointsConfig{},
|
influxdb.BatchPointsConfig{},
|
||||||
kitlog.LoggerFunc(func(kv ...interface{}) error {
|
kitlog.LoggerFunc(func(kv ...interface{}) error {
|
||||||
log.FromContext(ctx).Error(kv)
|
log.FromContext(ctx).Error(kv...)
|
||||||
return nil
|
return nil
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
|
@ -50,7 +50,7 @@ func RegisterStatsd(ctx context.Context, config *types.Statsd) Registry {
|
||||||
}
|
}
|
||||||
|
|
||||||
statsdClient = statsd.New(config.Prefix+".", kitlog.LoggerFunc(func(keyvals ...interface{}) error {
|
statsdClient = statsd.New(config.Prefix+".", kitlog.LoggerFunc(func(keyvals ...interface{}) error {
|
||||||
log.WithoutContext().WithField(log.MetricsProviderName, "statsd").Info(keyvals)
|
log.WithoutContext().WithField(log.MetricsProviderName, "statsd").Info(keyvals...)
|
||||||
return nil
|
return nil
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
|
@ -94,7 +94,6 @@ func (h *httpForwarder) Accept() (net.Conn, error) {
|
||||||
//
|
//
|
||||||
// - TCP-TLS HostSNI(`foobar`) and HTTPS PathPrefix(`/`)
|
// - TCP-TLS HostSNI(`foobar`) and HTTPS PathPrefix(`/`)
|
||||||
// - On v2.6 and v2.7, the TCP-TLS one takes precedence.
|
// - On v2.6 and v2.7, the TCP-TLS one takes precedence.
|
||||||
//
|
|
||||||
func Test_Routing(t *testing.T) {
|
func Test_Routing(t *testing.T) {
|
||||||
// This listener simulates the backend service.
|
// This listener simulates the backend service.
|
||||||
// It is capable of switching into server first communication mode,
|
// It is capable of switching into server first communication mode,
|
||||||
|
|
|
@ -73,6 +73,7 @@ func (c Chain) Append(constructors ...Constructor) Chain {
|
||||||
// // requests in ext2Chain go m1 -> m2 -> m3 -> m4
|
// // requests in ext2Chain go m1 -> m2 -> m3 -> m4
|
||||||
//
|
//
|
||||||
// Another example:
|
// Another example:
|
||||||
|
//
|
||||||
// aHtmlAfterNosurf := tcp.NewChain(m2)
|
// aHtmlAfterNosurf := tcp.NewChain(m2)
|
||||||
// aHtml := tcp.NewChain(m1, func(h tcp.Handler) tcp.Handler {
|
// aHtml := tcp.NewChain(m1, func(h tcp.Handler) tcp.Handler {
|
||||||
// csrf := nosurf.New(h)
|
// csrf := nosurf.New(h)
|
||||||
|
|
|
@ -10,15 +10,15 @@ type haystackLogger struct {
|
||||||
|
|
||||||
// Error prints the error message.
|
// Error prints the error message.
|
||||||
func (l haystackLogger) Error(format string, v ...interface{}) {
|
func (l haystackLogger) Error(format string, v ...interface{}) {
|
||||||
l.logger.Errorf(format, v)
|
l.logger.Errorf(format, v...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Info prints the info message.
|
// Info prints the info message.
|
||||||
func (l haystackLogger) Info(format string, v ...interface{}) {
|
func (l haystackLogger) Info(format string, v ...interface{}) {
|
||||||
l.logger.Infof(format, v)
|
l.logger.Infof(format, v...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// Debug prints the info message.
|
// Debug prints the info message.
|
||||||
func (l haystackLogger) Debug(format string, v ...interface{}) {
|
func (l haystackLogger) Debug(format string, v ...interface{}) {
|
||||||
l.logger.Debug(format, v)
|
l.logger.Debugf(format, v...)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue