You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2026-06-03 18:35:08 +02:00
Modernize (#7089)
Use https://pkg.go.dev/golang.org/x/tools/gopls/internal/analysis/modernize to update code to new style. --------- Co-authored-by: Flc゛ <four_leaf_clover@foxmail.com> Co-authored-by: Damien Mathieu <42@dmathieu.com>
This commit is contained in:
committed by
GitHub
parent
7bcbb6a49a
commit
5e1c62a2d5
@@ -898,7 +898,7 @@ func TestHTTPAttributesFromHTTPStatusCode(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSpanStatusFromHTTPStatusCode(t *testing.T) {
|
||||
for code := 0; code < 1000; code++ {
|
||||
for code := range 1000 {
|
||||
expected := getExpectedCodeForHTTPCode(code, trace.SpanKindClient)
|
||||
got, msg := SpanStatusFromHTTPStatusCode(code)
|
||||
assert.Equalf(t, expected, got, "%s vs %s", expected, got)
|
||||
@@ -913,7 +913,7 @@ func TestSpanStatusFromHTTPStatusCode(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSpanStatusFromHTTPStatusCodeAndSpanKind(t *testing.T) {
|
||||
for code := 0; code < 1000; code++ {
|
||||
for code := range 1000 {
|
||||
expected := getExpectedCodeForHTTPCode(code, trace.SpanKindClient)
|
||||
got, msg := SpanStatusFromHTTPStatusCodeAndSpanKind(code, trace.SpanKindClient)
|
||||
assert.Equalf(t, expected, got, "%s vs %s", expected, got)
|
||||
@@ -954,7 +954,7 @@ func getExpectedCodeForHTTPCode(code int, spanKind trace.SpanKind) codes.Code {
|
||||
return codes.Error
|
||||
}
|
||||
|
||||
func assertElementsMatch(t *testing.T, expected, got []attribute.KeyValue, format string, args ...interface{}) {
|
||||
func assertElementsMatch(t *testing.T, expected, got []attribute.KeyValue, format string, args ...any) {
|
||||
if !assert.ElementsMatchf(t, expected, got, format, args...) {
|
||||
t.Log("expected:", kvStr(expected))
|
||||
t.Log("got:", kvStr(got))
|
||||
|
||||
Reference in New Issue
Block a user