From be60a911ba1e121bc5dcaeda35e64c72b74f808b Mon Sep 17 00:00:00 2001 From: armfazh Date: Wed, 11 May 2022 11:29:37 -0700 Subject: [PATCH] Moving golnagci-lint to v1.46 --- .github/workflows/ci-actions.yml | 2 +- ecc/fourq/point_test.go | 16 +++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/ci-actions.yml b/.github/workflows/ci-actions.yml index bf57a80a7..35203439a 100644 --- a/.github/workflows/ci-actions.yml +++ b/.github/workflows/ci-actions.yml @@ -23,7 +23,7 @@ jobs: - name: Linting uses: golangci/golangci-lint-action@v3 with: - version: v1.45 + version: v1.46 args: --config=./.etc/golangci.yml ./... - name: Check shadowing run: | diff --git a/ecc/fourq/point_test.go b/ecc/fourq/point_test.go index 8b533dbc9..7bbfd2f97 100644 --- a/ecc/fourq/point_test.go +++ b/ecc/fourq/point_test.go @@ -125,7 +125,7 @@ func TestScalarMult(t *testing.T) { func TestScalar(t *testing.T) { const testTimes = 1 << 12 - var x, xx [5]uint64 + var xx [5]uint64 two256 := big.NewInt(1) two256.Lsh(two256, 256) two64 := big.NewInt(1) @@ -137,9 +137,7 @@ func TestScalar(t *testing.T) { for i := 0; i < testTimes; i++ { bigX, _ := rand.Int(rand.Reader, two256) conv.BigInt2Uint64Le(xx[:], bigX) - for j := range xx { - x[j] = xx[j] - } + x := xx bigY, _ := rand.Int(rand.Reader, two64) y := bigY.Int64() bigY.SetInt64(y) @@ -160,9 +158,7 @@ func TestScalar(t *testing.T) { for i := 0; i < testTimes; i++ { bigX, _ := rand.Int(rand.Reader, two256) conv.BigInt2Uint64Le(xx[:], bigX) - for j := range xx { - x[j] = xx[j] - } + x := xx bigY, _ := rand.Int(rand.Reader, two64) y := bigY.Int64() bigY.SetInt64(y) @@ -182,9 +178,7 @@ func TestScalar(t *testing.T) { for i := 0; i < testTimes; i++ { bigX, _ := rand.Int(rand.Reader, two256) conv.BigInt2Uint64Le(xx[:], bigX) - for j := range xx { - x[j] = xx[j] - } + x := xx condAddOrderN(&x) got := conv.Uint64Le2BigInt(x[:]) @@ -219,7 +213,7 @@ func TestScalar(t *testing.T) { } if got.Cmp(want) != 0 { - test.ReportError(t, got, want, x) + test.ReportError(t, got, want, k) } } })