diff --git a/.golangci.yml b/.golangci.yml index 43af4c3..1fbb8db 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -41,6 +41,7 @@ linters: - maintidx # maintidx measures the maintainability index of each function. - makezero # Finds slice declarations with non-zero initial length - misspell # Finds commonly misspelled English words in comments + - modernize # Replace and suggests simplifications to code - nakedret # Finds naked returns in functions greater than a specified function length - nestif # Reports deeply nested if statements - nilerr # Finds the code that returns nil even if it checks that the error is not nil. diff --git a/transport_go_test.go b/transport_go_test.go index 38ce38e..507f255 100644 --- a/transport_go_test.go +++ b/transport_go_test.go @@ -2,7 +2,6 @@ // SPDX-License-Identifier: MIT //go:build !js -// +build !js package quic @@ -108,8 +107,8 @@ func TestTransport_E2E(t *testing.T) { // sent side var buf [2]byte - for i := 0; i < count; i++ { - testData := bytes.Repeat([]byte(fmt.Sprintf("%04d", i)), repeat) + for i := range count { + testData := bytes.Repeat(fmt.Appendf(nil, "%04d", i), repeat) binary.BigEndian.PutUint16(buf[:], uint16(i)) //nolint:gosec assert.GreaterOrEqual(t, len(testData), 2) testData = append(testData, buf[0], buf[1]) //nolint:gosec