From aed4d8df0c9771b9e307ff231dc988efc60160b5 Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Sun, 1 Dec 2024 12:27:32 +0800 Subject: [PATCH] ci: disable the unparam linter for tests (#4738) --- .golangci.yml | 1 + http3/http3_suite_test.go | 1 - internal/handshake/updatable_aead_test.go | 1 - internal/qtls/qtls_test.go | 1 - qlog/json_helper_test.go | 1 - 5 files changed, 1 insertion(+), 4 deletions(-) diff --git a/.golangci.yml b/.golangci.yml index 72a4c7ad7..440520220 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -44,3 +44,4 @@ issues: linters: - exhaustive - prealloc + - unparam diff --git a/http3/http3_suite_test.go b/http3/http3_suite_test.go index b34003b92..53ad1a0f4 100644 --- a/http3/http3_suite_test.go +++ b/http3/http3_suite_test.go @@ -26,7 +26,6 @@ var _ = AfterEach(func() { mockCtrl.Finish() }) -//nolint:unparam func scaleDuration(t time.Duration) time.Duration { scaleFactor := 1 if f, err := strconv.Atoi(os.Getenv("TIMESCALE_FACTOR")); err == nil { // parsing "" errors, so this works fine if the env is not set diff --git a/internal/handshake/updatable_aead_test.go b/internal/handshake/updatable_aead_test.go index b5053f02d..b95ae5a36 100644 --- a/internal/handshake/updatable_aead_test.go +++ b/internal/handshake/updatable_aead_test.go @@ -329,7 +329,6 @@ func TestRejectFrequentKeyUpdates(t *testing.T) { }, err) } -//nolint:unparam func setKeyUpdateIntervals(t *testing.T, firstKeyUpdateInterval, keyUpdateInterval uint64) { origKeyUpdateInterval := KeyUpdateInterval origFirstKeyUpdateInterval := FirstKeyUpdateInterval diff --git a/internal/qtls/qtls_test.go b/internal/qtls/qtls_test.go index b201fc8ee..28f887b1b 100644 --- a/internal/qtls/qtls_test.go +++ b/internal/qtls/qtls_test.go @@ -109,7 +109,6 @@ func TestServerConfigGetConfigForClientRecursively(t *testing.T) { var localAddr, remoteAddr net.Addr tlsConf := &tls.Config{} var innerConf *tls.Config - //nolint:unparam getCert := func(info *tls.ClientHelloInfo) (*tls.Certificate, error) { localAddr = info.Conn.LocalAddr() remoteAddr = info.Conn.RemoteAddr() diff --git a/qlog/json_helper_test.go b/qlog/json_helper_test.go index d63cb41c2..77b94f84f 100644 --- a/qlog/json_helper_test.go +++ b/qlog/json_helper_test.go @@ -11,7 +11,6 @@ import ( "github.com/stretchr/testify/require" ) -//nolint:unparam func scaleDuration(t time.Duration) time.Duration { scaleFactor := 1 if f, err := strconv.Atoi(os.Getenv("TIMESCALE_FACTOR")); err == nil { // parsing "" errors, so this works fine if the env is not set