Update linter

This commit is contained in:
Ludovic Fernandez 2020-05-11 12:06:07 +02:00 committed by GitHub
parent f12c27aa7c
commit 328611c619
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
157 changed files with 489 additions and 508 deletions

View file

@ -10,10 +10,10 @@ import (
datadog "gopkg.in/DataDog/dd-trace-go.v1/ddtrace/tracer"
)
// Name sets the name of this tracer
// Name sets the name of this tracer.
const Name = "datadog"
// Config provides configuration settings for a datadog tracer
// Config provides configuration settings for a datadog tracer.
type Config struct {
LocalAgentHostPort string `description:"Set datadog-agent's host:port that the reporter will used." json:"localAgentHostPort,omitempty" toml:"localAgentHostPort,omitempty" yaml:"localAgentHostPort,omitempty"`
GlobalTag string `description:"Key:Value tag to be set on all the spans." json:"globalTag,omitempty" toml:"globalTag,omitempty" yaml:"globalTag,omitempty" export:"true"`
@ -33,7 +33,7 @@ func (c *Config) SetDefaults() {
c.PrioritySampling = false
}
// Setup sets up the tracer
// Setup sets up the tracer.
func (c *Config) Setup(serviceName string) (opentracing.Tracer, io.Closer, error) {
tag := strings.SplitN(c.GlobalTag, ":", 2)

View file

@ -10,10 +10,10 @@ import (
"github.com/opentracing/opentracing-go"
)
// Name sets the name of this tracer
// Name sets the name of this tracer.
const Name = "haystack"
// Config provides configuration settings for a haystack tracer
// Config provides configuration settings for a haystack tracer.
type Config struct {
LocalAgentHost string `description:"Set haystack-agent's host that the reporter will used." json:"localAgentHost,omitempty" toml:"localAgentHost,omitempty" yaml:"localAgentHost,omitempty"`
LocalAgentPort int `description:"Set haystack-agent's port that the reporter will used." json:"localAgentPort,omitempty" toml:"localAgentPort,omitempty" yaml:"localAgentPort,omitempty"`
@ -30,7 +30,7 @@ func (c *Config) SetDefaults() {
c.LocalAgentPort = 35000
}
// Setup sets up the tracer
// Setup sets up the tracer.
func (c *Config) Setup(serviceName string) (opentracing.Tracer, io.Closer, error) {
tag := strings.SplitN(c.GlobalTag, ":", 2)

View file

@ -4,22 +4,21 @@ import (
"github.com/containous/traefik/v2/pkg/log"
)
/*NullLogger does nothing*/
type haystackLogger struct {
logger log.Logger
}
/*Error prints the error message*/
// Error prints the error message.
func (l haystackLogger) Error(format string, v ...interface{}) {
l.logger.Errorf(format, v)
}
/*Info prints the info message*/
// Info prints the info message.
func (l haystackLogger) Info(format string, v ...interface{}) {
l.logger.Infof(format, v)
}
/*Debug prints the info message*/
// Debug prints the info message.
func (l haystackLogger) Debug(format string, v ...interface{}) {
l.logger.Debug(format, v)
}

View file

@ -8,10 +8,10 @@ import (
"github.com/opentracing/opentracing-go"
)
// Name sets the name of this tracer
// Name sets the name of this tracer.
const Name = "instana"
// Config provides configuration settings for a instana tracer
// Config provides configuration settings for a instana tracer.
type Config struct {
LocalAgentHost string `description:"Set instana-agent's host that the reporter will used." json:"localAgentHost,omitempty" toml:"localAgentHost,omitempty" yaml:"localAgentHost,omitempty"`
LocalAgentPort int `description:"Set instana-agent's port that the reporter will used." json:"localAgentPort,omitempty" toml:"localAgentPort,omitempty" yaml:"localAgentPort,omitempty"`
@ -24,7 +24,7 @@ func (c *Config) SetDefaults() {
c.LogLevel = "info"
}
// Setup sets up the tracer
// Setup sets up the tracer.
func (c *Config) Setup(serviceName string) (opentracing.Tracer, io.Closer, error) {
// set default logLevel
logLevel := instana.Info

View file

@ -52,7 +52,7 @@ func (c *Collector) SetDefaults() {
c.Password = ""
}
// Setup sets up the tracer
// Setup sets up the tracer.
func (c *Config) Setup(componentName string) (opentracing.Tracer, io.Closer, error) {
reporter := &jaegercfg.ReporterConfig{
LogSpans: true,

View file

@ -5,7 +5,7 @@ import (
"github.com/sirupsen/logrus"
)
// jaegerLogger is an implementation of the Logger interface that delegates to traefik log
// jaegerLogger is an implementation of the Logger interface that delegates to traefik log.
type jaegerLogger struct {
logger logrus.FieldLogger
}
@ -20,7 +20,7 @@ func (l *jaegerLogger) Error(msg string) {
l.logger.Errorf("Tracing jaeger error: %s", msg)
}
// Infof logs a message at debug priority
// Infof logs a message at debug priority.
func (l *jaegerLogger) Infof(msg string, args ...interface{}) {
l.logger.Debugf(msg, args...)
}

View file

@ -94,7 +94,7 @@ func (t *Tracing) IsEnabled() bool {
return t != nil && t.tracer != nil
}
// Close tracer
// Close tracer.
func (t *Tracing) Close() {
if t.closer != nil {
err := t.closer.Close()
@ -148,7 +148,7 @@ func LogEventf(r *http.Request, format string, args ...interface{}) {
}
}
// StartSpan starts a new span from the one in the request context
// StartSpan starts a new span from the one in the request context.
func StartSpan(r *http.Request, operationName string, spanKind ext.SpanKindEnum, opts ...opentracing.StartSpanOption) (opentracing.Span, *http.Request, func()) {
span, ctx := opentracing.StartSpanFromContext(r.Context(), operationName, opts...)

View file

@ -30,7 +30,7 @@ func (c *Config) SetDefaults() {
c.SampleRate = 1.0
}
// Setup sets up the tracer
// Setup sets up the tracer.
func (c *Config) Setup(serviceName string) (opentracing.Tracer, io.Closer, error) {
// create our local endpoint
endpoint, err := zipkin.NewEndpoint(serviceName, "0.0.0.0:0")