1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2026-06-03 18:35:08 +02:00

Use gofumpt instead of gofmt (#4623)

* Use gofumpt instead of gofmt in golangci-lint conf

* Run gofumpt fixes

* Format generated templates

---------

Co-authored-by: Chester Cheung <cheung.zhy.csu@gmail.com>
This commit is contained in:
Tyler Yahn
2023-10-16 10:02:21 -07:00
committed by GitHub
parent 9900450477
commit 5dff273a1e
73 changed files with 255 additions and 209 deletions
+1
View File
@@ -268,6 +268,7 @@ func (o stackTraceOption) applyEvent(c EventConfig) EventConfig {
c.stackTrace = bool(o)
return c
}
func (o stackTraceOption) applySpan(c SpanConfig) SpanConfig {
c.stackTrace = bool(o)
return c
+8 -4
View File
@@ -48,8 +48,10 @@ func (e errorConst) Error() string {
// nolint:revive // revive complains about stutter of `trace.TraceID`.
type TraceID [16]byte
var nilTraceID TraceID
var _ json.Marshaler = nilTraceID
var (
nilTraceID TraceID
_ json.Marshaler = nilTraceID
)
// IsValid checks whether the trace TraceID is valid. A valid trace ID does
// not consist of zeros only.
@@ -71,8 +73,10 @@ func (t TraceID) String() string {
// SpanID is a unique identity of a span in a trace.
type SpanID [8]byte
var nilSpanID SpanID
var _ json.Marshaler = nilSpanID
var (
nilSpanID SpanID
_ json.Marshaler = nilSpanID
)
// IsValid checks whether the SpanID is valid. A valid SpanID does not consist
// of zeros only.
+4 -10
View File
@@ -309,7 +309,7 @@ func TestSpanContextHasTraceID(t *testing.T) {
},
} {
t.Run(testcase.name, func(t *testing.T) {
//proto: func (sc SpanContext) HasTraceID() bool{}
// proto: func (sc SpanContext) HasTraceID() bool{}
sc := SpanContext{traceID: testcase.tid}
have := sc.HasTraceID()
if have != testcase.want {
@@ -336,7 +336,7 @@ func TestSpanContextHasSpanID(t *testing.T) {
},
} {
t.Run(testcase.name, func(t *testing.T) {
//proto: func (sc SpanContext) HasSpanID() bool {}
// proto: func (sc SpanContext) HasSpanID() bool {}
have := testcase.sc.HasSpanID()
if have != testcase.want {
t.Errorf("Want: %v, but have: %v", testcase.want, have)
@@ -435,7 +435,7 @@ func TestStringTraceID(t *testing.T) {
},
} {
t.Run(testcase.name, func(t *testing.T) {
//proto: func (t TraceID) String() string {}
// proto: func (t TraceID) String() string {}
have := testcase.tid.String()
if have != testcase.want {
t.Errorf("Want: %s, but have: %s", testcase.want, have)
@@ -462,7 +462,7 @@ func TestStringSpanID(t *testing.T) {
},
} {
t.Run(testcase.name, func(t *testing.T) {
//proto: func (t TraceID) String() string {}
// proto: func (t TraceID) String() string {}
have := testcase.sid.String()
if have != testcase.want {
t.Errorf("Want: %s, but have: %s", testcase.want, have)
@@ -481,17 +481,14 @@ func TestValidateSpanKind(t *testing.T) {
SpanKindInternal,
},
{
SpanKindInternal,
SpanKindInternal,
},
{
SpanKindServer,
SpanKindServer,
},
{
SpanKindClient,
SpanKindClient,
},
@@ -521,17 +518,14 @@ func TestSpanKindString(t *testing.T) {
"unspecified",
},
{
SpanKindInternal,
"internal",
},
{
SpanKindServer,
"server",
},
{
SpanKindClient,
"client",
},
+2 -1
View File
@@ -495,7 +495,8 @@ func TestTraceStateInsert(t *testing.T) {
),
}
}(),
}}
},
}
for _, tc := range testCases {
t.Run(tc.name, func(t *testing.T) {