From 7149090c812c13a7482d0ac6db410757beabcbb1 Mon Sep 17 00:00:00 2001 From: Kemal Akkoyun Date: Thu, 16 Jan 2025 12:59:09 +0100 Subject: [PATCH] fix(staticcheck): Fix trivial go vet issues Signed-off-by: Kemal Akkoyun --- contrib/jackc/pgx.v5/example_test.go | 2 +- contrib/labstack/echo.v4/appsec_test.go | 1 - internal/utils_test.go | 3 ++- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/contrib/jackc/pgx.v5/example_test.go b/contrib/jackc/pgx.v5/example_test.go index 7be774dc57..9ca12b9c2a 100644 --- a/contrib/jackc/pgx.v5/example_test.go +++ b/contrib/jackc/pgx.v5/example_test.go @@ -45,7 +45,7 @@ func ExampleConnect() { } } -func ExamplePool() { +func ExampleNewPool() { ctx := context.TODO() // The pgxpool uses the same tracer and is exposed the same way. diff --git a/contrib/labstack/echo.v4/appsec_test.go b/contrib/labstack/echo.v4/appsec_test.go index 52d9a184b9..6108f62d3f 100644 --- a/contrib/labstack/echo.v4/appsec_test.go +++ b/contrib/labstack/echo.v4/appsec_test.go @@ -271,7 +271,6 @@ func TestControlFlow(t *testing.T) { }, handler: func(echo.Context) error { panic("unexpected control flow") - return nil }, test: func(t *testing.T, rec *httptest.ResponseRecorder, mt mocktracer.Tracer, err error) { require.Error(t, err) diff --git a/internal/utils_test.go b/internal/utils_test.go index bfa4ee6640..e847fe11ac 100644 --- a/internal/utils_test.go +++ b/internal/utils_test.go @@ -26,7 +26,8 @@ func BenchmarkIter(b *testing.B) { func TestLockMapThrash(t *testing.T) { wg := sync.WaitGroup{} - ctx, _ := context.WithTimeout(context.Background(), 20*time.Millisecond) + ctx, cancel := context.WithTimeout(context.Background(), 20*time.Millisecond) + t.Cleanup(cancel) lm := NewLockMap(map[string]string{}) wg.Add(6) for i := 0; i < 3; i++ {