From bace98b79dd1061351c667a1a517b0948742eea4 Mon Sep 17 00:00:00 2001 From: Matthieu MOREL Date: Mon, 30 Sep 2024 09:13:44 +0200 Subject: [PATCH] [chore]: enable formatter rule from testifylint (#6156) Testifylint is a linter that provides best practices with the use of testify. This PR enables [formatter](https://github.com/Antonboom/testifylint?tab=readme-ov-file#formatter) rule from [testifylint](https://github.com/Antonboom/testifylint) Signed-off-by: Matthieu MOREL --- .golangci.yml | 1 - instrumentation/runtime/runtime_test.go | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 0a1c8ea87ec..eb8df6cf4a0 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -260,5 +260,4 @@ linters-settings: enable-all: true disable: - float-compare - - formatter - require-error diff --git a/instrumentation/runtime/runtime_test.go b/instrumentation/runtime/runtime_test.go index 67df9768580..864916af193 100644 --- a/instrumentation/runtime/runtime_test.go +++ b/instrumentation/runtime/runtime_test.go @@ -5,7 +5,6 @@ package runtime // import "go.opentelemetry.io/contrib/instrumentation/runtime" import ( "context" - "fmt" "math" "runtime/debug" "testing" @@ -182,7 +181,7 @@ func assertNonZeroValues(t *testing.T, sm metricdata.ScopeMetrics) { switch a := m.Data.(type) { case metricdata.Sum[int64]: for _, dp := range a.DataPoints { - assert.Positive(t, dp.Value, fmt.Sprintf("Metric %q should have a non-zero value for point with attributes %+v", m.Name, dp.Attributes)) + assert.Positivef(t, dp.Value, "Metric %q should have a non-zero value for point with attributes %+v", m.Name, dp.Attributes) } default: t.Fatalf("unexpected data type %v", a)