diff --git a/.circleci/config.yml b/.circleci/config.yml index e9d286fc2f..def54fef46 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -72,7 +72,7 @@ commands: executors: golang: docker: - - image: cimg/go:1.19.10 + - image: cimg/go:1.20.11 jobs: test_all: diff --git a/.github/workflows/baisc_checks.yml b/.github/workflows/baisc_checks.yml index b08f460548..90940693e5 100644 --- a/.github/workflows/baisc_checks.yml +++ b/.github/workflows/baisc_checks.yml @@ -35,7 +35,7 @@ jobs: - name: Lint run: | - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.50.0 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.51.0 golangci-lint run --timeout 10m - name: Compatible all diff --git a/.github/workflows/common_go.yml b/.github/workflows/common_go.yml index 3b94b11d9c..6b37e1d8d4 100644 --- a/.github/workflows/common_go.yml +++ b/.github/workflows/common_go.yml @@ -51,7 +51,7 @@ jobs: - name: Lint run: | - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.50.0 + curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.51.0 golangci-lint run --timeout 10m - name: Detect changes diff --git a/pkg/messagepool/block_proba_test.go b/pkg/messagepool/block_proba_test.go index 1e0bac14b8..540bc0fea3 100644 --- a/pkg/messagepool/block_proba_test.go +++ b/pkg/messagepool/block_proba_test.go @@ -26,7 +26,7 @@ func TestBlockProbability(t *testing.T) { func TestWinnerProba(t *testing.T) { tf.UnitTest(t) - rand.Seed(time.Now().UnixNano()) + rand.New(rand.NewSource(time.Now().UnixNano())) const N = 1000000 winnerProba := noWinnersProb() sum := 0 diff --git a/pkg/repo/fskeystore/fskeystore_test.go b/pkg/repo/fskeystore/fskeystore_test.go index fbbbc2455c..1bafff4e8e 100644 --- a/pkg/repo/fskeystore/fskeystore_test.go +++ b/pkg/repo/fskeystore/fskeystore_test.go @@ -2,8 +2,8 @@ package fskeystore import ( "bytes" + "crypto/rand" "fmt" - "math/rand" "os" "path/filepath" "sort" diff --git a/pkg/util/fr32/fr32_test.go b/pkg/util/fr32/fr32_test.go index a222632bb3..182433d3c0 100644 --- a/pkg/util/fr32/fr32_test.go +++ b/pkg/util/fr32/fr32_test.go @@ -2,8 +2,8 @@ package fr32_test import ( "bytes" + "crypto/rand" "io" - "math/rand" "os" "testing" diff --git a/venus-shared/testutil/value_provider_primitive_test.go b/venus-shared/testutil/value_provider_primitive_test.go index 65bf21d56c..849b5069cf 100644 --- a/venus-shared/testutil/value_provider_primitive_test.go +++ b/venus-shared/testutil/value_provider_primitive_test.go @@ -13,7 +13,7 @@ import ( func getRand() *rand.Rand { seed := time.Now().UnixNano() - rand.Seed(seed) + rand.New(rand.NewSource(seed)) return rand.New(rand.NewSource(seed)) }