Enable all linters by default

This removes the directive from .golangci.yml to disable all linters,
and fixes the relevant bugs / issues that are exposed.
This commit is contained in:
Sargun Dhillon
2020-12-03 11:33:06 -08:00
parent d562b71d9a
commit d64d427ec8
8 changed files with 14 additions and 33 deletions

View File

@@ -47,7 +47,6 @@ func NewCommand(s *provider.Store) *cobra.Command {
}
fmt.Fprintln(cmd.OutOrStdout(), args[0])
}
return
},
}
}

View File

@@ -40,7 +40,7 @@ func NewJaegerExporter(opts TracingExporterOptions) (trace.Exporter, error) {
},
}
if jOpts.Endpoint == "" && jOpts.AgentEndpoint == "" {
if jOpts.Endpoint == "" && jOpts.AgentEndpoint == "" { // nolint:staticcheck
return nil, errors.New("Must specify either JAEGER_ENDPOINT or JAEGER_AGENT_ENDPOINT")
}

View File

@@ -329,7 +329,7 @@ func (p *MockProvider) GetPods(ctx context.Context) ([]*v1.Pod, error) {
}
func (p *MockProvider) ConfigureNode(ctx context.Context, n *v1.Node) {
ctx, span := trace.StartSpan(ctx, "mock.ConfigureNode") //nolint:ineffassign
ctx, span := trace.StartSpan(ctx, "mock.ConfigureNode") // nolint:staticcheck,ineffassign
defer span.End()
n.Status.Capacity = p.capacity()
@@ -429,7 +429,7 @@ func (p *MockProvider) nodeDaemonEndpoints() v1.NodeDaemonEndpoints {
// GetStatsSummary returns dummy stats for all pods known by this provider.
func (p *MockProvider) GetStatsSummary(ctx context.Context) (*stats.Summary, error) {
var span trace.Span
ctx, span = trace.StartSpan(ctx, "GetStatsSummary") //nolint: ineffassign
ctx, span = trace.StartSpan(ctx, "GetStatsSummary") //nolint: ineffassign,staticcheck
defer span.End()
// Grab the current timestamp so we can report it as the time the stats were generated.