[#1718] linter: Resolve gocritic's unslice linter

See https://go-critic.com/overview#unslice for details.

Change-Id: I6d21e8ce1c9bae56099dc203f5080b0e3ea0c1ef
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
Dmitrii Stepanov 2025-04-16 14:28:21 +03:00
parent cf48069fd8
commit 2075e09ced
Signed by: dstepanov-yadro
GPG key ID: 237AF1A763293BC0
3 changed files with 4 additions and 4 deletions

View file

@ -63,7 +63,7 @@ func dumpNetworkConfig(cmd *cobra.Command, _ []string) error {
netmap.MaxObjectSizeConfig, netmap.WithdrawFeeConfig,
netmap.MaxECDataCountConfig, netmap.MaxECParityCountConfig:
nbuf := make([]byte, 8)
copy(nbuf[:], v)
copy(nbuf, v)
n := binary.LittleEndian.Uint64(nbuf)
_, _ = tw.Write(fmt.Appendf(nil, "%s:\t%d (int)\n", k, n))
case netmap.HomomorphicHashingDisabledKey, netmap.MaintenanceModeAllowedConfig:

View file

@ -57,7 +57,7 @@ func DefaultRecordParser(key, value []byte) (common.SchemaEntry, common.Parser,
r.addr.SetContainer(cnr)
r.addr.SetObject(obj)
r.data = value[:]
r.data = value
return &r, nil, nil
}

View file

@ -363,12 +363,12 @@ func (db *DB) deleteObject(
func parentLength(tx *bbolt.Tx, addr oid.Address) int {
bucketName := make([]byte, bucketKeySize)
bkt := tx.Bucket(parentBucketName(addr.Container(), bucketName[:]))
bkt := tx.Bucket(parentBucketName(addr.Container(), bucketName))
if bkt == nil {
return 0
}
lst, err := decodeList(bkt.Get(objectKey(addr.Object(), bucketName[:])))
lst, err := decodeList(bkt.Get(objectKey(addr.Object(), bucketName)))
if err != nil {
return 0
}