forked from TrueCloudLab/frostfs-node
[#1689] go.mod: Bump SDK version
* Fix `APEOverride` method usage in ape checker. * Fix linter errors: factor out deprecated methods and packages. Change-Id: I8c939f4c58c2a4e3c4e795c7224d935d40ce6f24 Signed-off-by: Airat Arifullin <a.arifullin@yadro.com>
This commit is contained in:
parent
652237500f
commit
8e2f919df0
9 changed files with 55 additions and 52 deletions
|
@ -1,7 +1,9 @@
|
|||
package testutil
|
||||
|
||||
import (
|
||||
cryptorand "crypto/rand"
|
||||
"encoding/binary"
|
||||
"math/rand"
|
||||
"sync/atomic"
|
||||
"testing"
|
||||
|
||||
|
@ -9,7 +11,6 @@ import (
|
|||
objectSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object"
|
||||
oid "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/object/id"
|
||||
"github.com/stretchr/testify/require"
|
||||
"golang.org/x/exp/rand"
|
||||
)
|
||||
|
||||
// AddressGenerator is the interface of types that generate object addresses.
|
||||
|
@ -61,7 +62,7 @@ var _ ObjectGenerator = &SeqObjGenerator{}
|
|||
|
||||
func generateObjectWithOIDWithCIDWithSize(oid oid.ID, cid cid.ID, sz uint64) *objectSDK.Object {
|
||||
data := make([]byte, sz)
|
||||
_, _ = rand.Read(data)
|
||||
_, _ = cryptorand.Read(data)
|
||||
obj := GenerateObjectWithCIDWithPayload(cid, data)
|
||||
obj.SetID(oid)
|
||||
return obj
|
||||
|
@ -82,7 +83,7 @@ var _ ObjectGenerator = &RandObjGenerator{}
|
|||
|
||||
func (g *RandObjGenerator) Next() *objectSDK.Object {
|
||||
var id oid.ID
|
||||
_, _ = rand.Read(id[:])
|
||||
_, _ = cryptorand.Read(id[:])
|
||||
return generateObjectWithOIDWithCIDWithSize(id, cid.ID{}, g.ObjSize)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue