[#1431] node: Fix 'empty slice declaration using a literal'

Signed-off-by: Alexander Chuprov <a.chuprov@yadro.com>
This commit is contained in:
Alexander Chuprov 2024-10-14 18:16:59 +03:00 committed by Evgenii Stratonikov
parent d83879d4b8
commit 41038b2ec0
4 changed files with 9 additions and 9 deletions

View file

@ -18,7 +18,7 @@ import (
)
func GeneratePayloadPool(count uint, size uint) [][]byte {
pool := [][]byte{}
var pool [][]byte
for i := uint(0); i < count; i++ {
payload := make([]byte, size)
_, _ = rand.Read(payload)
@ -29,7 +29,7 @@ func GeneratePayloadPool(count uint, size uint) [][]byte {
}
func GenerateAttributePool(count uint) []objectSDK.Attribute {
pool := []objectSDK.Attribute{}
var pool []objectSDK.Attribute
for i := uint(0); i < count; i++ {
for j := uint(0); j < count; j++ {
attr := *objectSDK.NewAttribute()
@ -42,7 +42,7 @@ func GenerateAttributePool(count uint) []objectSDK.Attribute {
}
func GenerateOwnerPool(count uint) []user.ID {
pool := []user.ID{}
var pool []user.ID
for i := uint(0); i < count; i++ {
pool = append(pool, usertest.ID())
}
@ -117,7 +117,7 @@ func WithPayloadFromPool(pool [][]byte) ObjectOption {
func WithAttributesFromPool(pool []objectSDK.Attribute, count uint) ObjectOption {
return func(obj *objectSDK.Object) {
attrs := []objectSDK.Attribute{}
var attrs []objectSDK.Attribute
for i := uint(0); i < count; i++ {
attrs = append(attrs, pool[rand.Intn(len(pool))])
}