forked from TrueCloudLab/frostfs-api-go
9dfc7e7fe9
Move all memory allocation and field settings in `Generate...(empty bool)` functions behind `if !empty` check. Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
20 lines
447 B
Go
20 lines
447 B
Go
package storagegrouptest
|
|
|
|
import (
|
|
refstest "github.com/nspcc-dev/neofs-api-go/v2/refs/test"
|
|
"github.com/nspcc-dev/neofs-api-go/v2/storagegroup"
|
|
)
|
|
|
|
func GenerateStorageGroup(empty bool) *storagegroup.StorageGroup {
|
|
m := new(storagegroup.StorageGroup)
|
|
|
|
if !empty {
|
|
m.SetValidationDataSize(44)
|
|
m.SetExpirationEpoch(55)
|
|
m.SetMembers(refstest.GenerateObjectIDs(false))
|
|
}
|
|
|
|
m.SetValidationHash(refstest.GenerateChecksum(empty))
|
|
|
|
return m
|
|
}
|