From 48c01fc8d51319caffb5aebe869b66f1a21f2803 Mon Sep 17 00:00:00 2001 From: Tien Nguyen Date: Wed, 24 Jan 2024 14:00:06 +0700 Subject: [PATCH] Using rand.New() instead of rand.Seed because it is deprecated. (#136) Co-authored-by: Duong Minh Ngoc <153509244+minhngoc274@users.noreply.github.com> --- x/feeabs/keeper/grpc_query_test.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/x/feeabs/keeper/grpc_query_test.go b/x/feeabs/keeper/grpc_query_test.go index 4781ece..7ec09f3 100644 --- a/x/feeabs/keeper/grpc_query_test.go +++ b/x/feeabs/keeper/grpc_query_test.go @@ -110,15 +110,15 @@ func (s *KeeperTestSuite) TestHostChainConfig() { } func randStringRunes(n int) string { - rand.Seed(time.Now().UnixNano()) //nolint:staticcheck // this is for testing + r := rand.New(rand.NewSource(time.Now().UnixNano())) b := make([]rune, n) for i := range b { - b[i] = letterRunes[rand.Intn(len(letterRunes))] + b[i] = letterRunes[r.Intn(len(letterRunes))] } return string(b) } func randUint64Num() uint64 { - rand.Seed(time.Now().UnixNano()) //nolint:staticcheck // this is for testing - return rand.Uint64() + r := rand.New(rand.NewSource(time.Now().UnixNano())) + return r.Uint64() }