1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2026-06-03 18:35:08 +02:00
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:
Mikhail Mazurskiy
2025-07-29 18:19:11 +10:00
committed by GitHub
parent 7bcbb6a49a
commit 5e1c62a2d5
97 changed files with 234 additions and 268 deletions
+3 -3
View File
@@ -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))