forked from TrueCloudLab/frostfs-node
[#587] Do not use math/rand.Read
Fix staticcheck warnings after go1.20 update. Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
This commit is contained in:
parent
33c11be0cf
commit
d641cba2fc
9 changed files with 33 additions and 27 deletions
|
@ -2,7 +2,8 @@ package blobstortest
|
|||
|
||||
import (
|
||||
"context"
|
||||
"math/rand"
|
||||
"crypto/rand"
|
||||
mrand "math/rand"
|
||||
"testing"
|
||||
|
||||
objectCore "git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/object"
|
||||
|
@ -53,8 +54,9 @@ func TestInfo(t *testing.T, cons Constructor, expectedType string, expectedPath
|
|||
func prepare(t *testing.T, count int, s common.Storage, min, max uint64) []objectDesc {
|
||||
objects := make([]objectDesc, count)
|
||||
|
||||
r := mrand.New(mrand.NewSource(0))
|
||||
for i := range objects {
|
||||
objects[i].obj = NewObject(min + uint64(rand.Intn(int(max-min+1)))) // not too large
|
||||
objects[i].obj = NewObject(min + uint64(r.Intn(int(max-min+1)))) // not too large
|
||||
objects[i].addr = objectCore.AddressOf(objects[i].obj)
|
||||
|
||||
raw, err := objects[i].obj.Marshal()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue