From 1ddb9fa5c42c84afdca30c98914b42fda3005a57 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20Soul=C3=A9?= Date: Fri, 21 Apr 2023 14:56:58 +0200 Subject: [PATCH] refactor: make golangci-lint v1.52.2 happy MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Except for stupid report about "unused-parameter". Signed-off-by: Maxime Soulé --- .github/workflows/ci.yml | 5 ++++- race_test.go | 9 ++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f57e09..1659c10 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -32,10 +32,13 @@ jobs: if: matrix.full-tests run: | curl -sL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | - sh -s -- -b $HOME/go/bin v1.51.0 + sh -s -- -b $HOME/go/bin v1.52.2 $HOME/go/bin/golangci-lint run --max-issues-per-linter 0 \ --max-same-issues 0 \ + --exclude="unused-parameter: parameter '[^']+' seems to be unused, consider removing or renaming it as _" \ + -E asciicheck \ -E bidichk \ + -E durationcheck \ -E exportloopref \ -E gocritic \ -E godot \ diff --git a/race_test.go b/race_test.go index 5afc89e..fd94097 100644 --- a/race_test.go +++ b/race_test.go @@ -2,13 +2,20 @@ package httpmock_test import ( "net/http" + "sync" "testing" . "github.com/jarcoal/httpmock" ) func TestActivateNonDefaultRace(t *testing.T) { + var wg sync.WaitGroup + wg.Add(10) for i := 0; i < 10; i++ { - go ActivateNonDefault(&http.Client{}) + go func() { + defer wg.Done() + ActivateNonDefault(&http.Client{}) + }() } + wg.Wait() }