Skip to content

Commit

Permalink
Format generated templates
Browse files Browse the repository at this point in the history
  • Loading branch information
MrAlias committed Oct 13, 2023
1 parent 1074978 commit 14dcc0e
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 12 deletions.
4 changes: 2 additions & 2 deletions internal/shared/internaltest/harness.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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()
},
Expand All @@ -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")
Expand Down
4 changes: 1 addition & 3 deletions internal/shared/internaltest/text_map_carrier_test.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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})
Expand Down
4 changes: 1 addition & 3 deletions internal/shared/matchers/expectation.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion internal/shared/otlp/otlpmetric/oconf/options_test.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion internal/shared/otlp/otlpmetric/otest/client.go.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 14dcc0e

Please sign in to comment.