diff --git a/internal/shared/internaltest/harness.go.tmpl b/internal/shared/internaltest/harness.go.tmpl index da3e7f18615..7223b9d2196 100644 --- a/internal/shared/internaltest/harness.go.tmpl +++ b/internal/shared/internaltest/harness.go.tmpl @@ -263,7 +263,7 @@ func (h *Harness) TestTracer(subjectFactory func() trace.Tracer) { } func (h *Harness) testSpan(tracerFactory func() trace.Tracer) { - var methods = map[string]func(span trace.Span){ + methods := map[string]func(span trace.Span){ "#End": func(span trace.Span) { span.End() }, @@ -283,7 +283,7 @@ func (h *Harness) testSpan(tracerFactory func() trace.Tracer) { span.SetAttributes(attribute.String("key1", "value"), attribute.Int("key2", 123)) }, } - var mechanisms = map[string]func() trace.Span{ + mechanisms := map[string]func() trace.Span{ "Span created via Tracer#Start": func() trace.Span { tracer := tracerFactory() _, subject := tracer.Start(context.Background(), "test") diff --git a/internal/shared/internaltest/text_map_carrier_test.go.tmpl b/internal/shared/internaltest/text_map_carrier_test.go.tmpl index faf713cc2d0..086c8af26ea 100644 --- a/internal/shared/internaltest/text_map_carrier_test.go.tmpl +++ b/internal/shared/internaltest/text_map_carrier_test.go.tmpl @@ -22,9 +22,7 @@ import ( "testing" ) -var ( - key, value = "test", "true" -) +var key, value = "test", "true" func TestTextMapCarrierKeys(t *testing.T) { tmc := NewTextMapCarrier(map[string]string{key: value}) diff --git a/internal/shared/matchers/expectation.go.tmpl b/internal/shared/matchers/expectation.go.tmpl index bdde84ea78a..4002fec51f1 100644 --- a/internal/shared/matchers/expectation.go.tmpl +++ b/internal/shared/matchers/expectation.go.tmpl @@ -27,9 +27,7 @@ import ( "time" ) -var ( - stackTracePruneRE = regexp.MustCompile(`runtime\/debug|testing|internal\/matchers`) -) +var stackTracePruneRE = regexp.MustCompile(`runtime\/debug|testing|internal\/matchers`) type Expectation struct { t *testing.T diff --git a/internal/shared/otlp/otlpmetric/oconf/options_test.go.tmpl b/internal/shared/otlp/otlpmetric/oconf/options_test.go.tmpl index 16ddfdb7b53..7c52efc51d9 100644 --- a/internal/shared/otlp/otlpmetric/oconf/options_test.go.tmpl +++ b/internal/shared/otlp/otlpmetric/oconf/options_test.go.tmpl @@ -203,7 +203,7 @@ func TestConfigs(t *testing.T) { }, asserts: func(t *testing.T, c *Config, grpcOption bool) { if grpcOption { - //TODO: make sure gRPC's credentials actually works + // TODO: make sure gRPC's credentials actually works assert.NotNil(t, c.Metrics.GRPCCredentials) } else { // nolint:staticcheck // ignoring tlsCert.RootCAs.Subjects is deprecated ERR because cert does not come from SystemCertPool. diff --git a/internal/shared/otlp/otlpmetric/otest/client.go.tmpl b/internal/shared/otlp/otlpmetric/otest/client.go.tmpl index 6c8be4982e5..37f25c9b468 100644 --- a/internal/shared/otlp/otlpmetric/otest/client.go.tmpl +++ b/internal/shared/otlp/otlpmetric/otest/client.go.tmpl @@ -38,7 +38,7 @@ import ( var ( // Sat Jan 01 2000 00:00:00 GMT+0000. - start = time.Date(2000, time.January, 01, 0, 0, 0, 0, time.FixedZone("GMT", 0)) + start = time.Date(2000, time.January, 0o1, 0, 0, 0, 0, time.FixedZone("GMT", 0)) end = start.Add(30 * time.Second) kvAlice = &cpb.KeyValue{Key: "user", Value: &cpb.AnyValue{ diff --git a/internal/shared/otlp/otlpmetric/transform/metricdata_test.go.tmpl b/internal/shared/otlp/otlpmetric/transform/metricdata_test.go.tmpl index b94c48dae8d..676e5785633 100644 --- a/internal/shared/otlp/otlpmetric/transform/metricdata_test.go.tmpl +++ b/internal/shared/otlp/otlpmetric/transform/metricdata_test.go.tmpl @@ -40,7 +40,7 @@ type unknownAggT struct { var ( // Sat Jan 01 2000 00:00:00 GMT+0000. - start = time.Date(2000, time.January, 01, 0, 0, 0, 0, time.FixedZone("GMT", 0)) + start = time.Date(2000, time.January, 0o1, 0, 0, 0, 0, time.FixedZone("GMT", 0)) end = start.Add(30 * time.Second) alice = attribute.NewSet(attribute.String("user", "alice")) diff --git a/internal/shared/otlp/otlptrace/otlpconfig/options_test.go.tmpl b/internal/shared/otlp/otlptrace/otlpconfig/options_test.go.tmpl index fcf99f0ad42..b83891a89f6 100644 --- a/internal/shared/otlp/otlptrace/otlpconfig/options_test.go.tmpl +++ b/internal/shared/otlp/otlptrace/otlpconfig/options_test.go.tmpl @@ -201,7 +201,7 @@ func TestConfigs(t *testing.T) { }, asserts: func(t *testing.T, c *Config, grpcOption bool) { if grpcOption { - //TODO: make sure gRPC's credentials actually works + // TODO: make sure gRPC's credentials actually works assert.NotNil(t, c.Traces.GRPCCredentials) } else { // nolint:staticcheck // ignoring tlsCert.RootCAs.Subjects is deprecated ERR because cert does not come from SystemCertPool.