From 87ff74311229db8682f64027f627f7fb7f7dd4dc Mon Sep 17 00:00:00 2001 From: Felipe Madero Date: Thu, 22 Feb 2024 15:14:09 -0300 Subject: [PATCH] bump go version --- .github/workflows/build-test.yml | 6 +++--- .github/workflows/release.yml | 2 +- .golangci.yml | 12 +++++++----- local/network_test.go | 9 +++++---- local/node_test.go | 2 +- 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-test.yml b/.github/workflows/build-test.yml index 4ac47475..1ceccb9f 100644 --- a/.github/workflows/build-test.yml +++ b/.github/workflows/build-test.yml @@ -17,7 +17,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: '~1.20.10' + go-version: '~1.21.7' check-latest: true - name: Run static analysis tests shell: bash @@ -29,7 +29,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-go@v3 with: - go-version: '~1.20.10' + go-version: '~1.21.7' - run: go test -v -timeout 10m -race ./... env: CGO_CFLAGS: "-O -D__BLST_PORTABLE__" # Set the CGO flags to use the portable version of BLST @@ -47,7 +47,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: '~1.20.10' + go-version: '~1.21.7' - name: Run e2e tests shell: bash run: scripts/tests.e2e.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 972fbd26..4496394b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -20,7 +20,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v3 with: - go-version: '~1.20.10' + go-version: '~1.21.7' - name: Set up arm64 cross compiler run: | sudo apt-get -y update diff --git a/.golangci.yml b/.golangci.yml index d81604e5..f092d5cf 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -106,8 +106,10 @@ linters-settings: excludes: - G107 # https://securego.io/docs/rules/g107.html depguard: - list-type: blacklist - packages-with-error-message: - - io/ioutil: 'io/ioutil is deprecated. Use package io or os instead.' - - github.com/stretchr/testify/assert: 'github.com/stretchr/testify/require should be used instead.' - include-go-root: true + rules: + packages: + deny: + - pkg: "io/ioutil" + desc: io/ioutil is deprecated. Use package io or os instead. + - pkg: "github.com/stretchr/testify/assert" + desc: github.com/stretchr/testify/require should be used instead. diff --git a/local/network_test.go b/local/network_test.go index 101095c7..7634be4d 100644 --- a/local/network_test.go +++ b/local/network_test.go @@ -482,7 +482,7 @@ func TestWrongNetworkConfigs(t *testing.T) { } require := require.New(t) for name, tt := range tests { - t.Run(name, func(t *testing.T) { + t.Run(name, func(*testing.T) { net, err := newNetwork(logging.NoLog{}, newMockAPISuccessful, &localTestSuccessfulNodeProcessCreator{}, "", "", false, false, false) require.NoError(err) err = net.loadConfig(context.Background(), tt.config) @@ -1164,11 +1164,11 @@ func TestWriteFiles(t *testing.T) { stakingKeyPath := filepath.Join(tmpDir, stakingKeyFileName) stakingCertPath := filepath.Join(tmpDir, stakingCertFileName) - stakingSigningKeyPath := filepath.Join(tmpDir, stakingSigningKeyFileName) + stakingSigningKeyPath := filepath.Join(tmpDir, stakingSigningKeyFileName) genesisPath := filepath.Join(tmpDir, genesisFileName) configFilePath := filepath.Join(tmpDir, configFileName) - chainConfigDir := filepath.Join(tmpDir, chainConfigSubDir) - subnetConfigDir := filepath.Join(tmpDir, subnetConfigSubDir) + chainConfigDir := filepath.Join(tmpDir, chainConfigSubDir) + subnetConfigDir := filepath.Join(tmpDir, subnetConfigSubDir) cChainConfigPath := filepath.Join(tmpDir, chainConfigSubDir, "C", configFileName) type test struct { @@ -1239,6 +1239,7 @@ func TestWriteFiles(t *testing.T) { } for _, tt := range tests { + tt := tt t.Run(tt.name, func(t *testing.T) { require := require.New(t) flags, err := writeFiles(0, tt.genesis, tmpDir, &tt.nodeConfig) diff --git a/local/node_test.go b/local/node_test.go index 9c846229..75e29a28 100644 --- a/local/node_test.go +++ b/local/node_test.go @@ -213,7 +213,7 @@ func TestAttachPeer(t *testing.T) { nodeID: ids.GenerateTestNodeID(), networkID: constants.MainnetID, p2pPort: 1, - getConnFunc: func(ctx context.Context, n node.Node) (net.Conn, error) { + getConnFunc: func(context.Context, node.Node) (net.Conn, error) { return peerConn, nil }, attachedPeers: map[string]peer.Peer{},