[#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:
parent
cf48069fd8
commit
2075e09ced
3 changed files with 4 additions and 4 deletions
|
@ -63,7 +63,7 @@ func dumpNetworkConfig(cmd *cobra.Command, _ []string) error {
|
||||||
netmap.MaxObjectSizeConfig, netmap.WithdrawFeeConfig,
|
netmap.MaxObjectSizeConfig, netmap.WithdrawFeeConfig,
|
||||||
netmap.MaxECDataCountConfig, netmap.MaxECParityCountConfig:
|
netmap.MaxECDataCountConfig, netmap.MaxECParityCountConfig:
|
||||||
nbuf := make([]byte, 8)
|
nbuf := make([]byte, 8)
|
||||||
copy(nbuf[:], v)
|
copy(nbuf, v)
|
||||||
n := binary.LittleEndian.Uint64(nbuf)
|
n := binary.LittleEndian.Uint64(nbuf)
|
||||||
_, _ = tw.Write(fmt.Appendf(nil, "%s:\t%d (int)\n", k, n))
|
_, _ = tw.Write(fmt.Appendf(nil, "%s:\t%d (int)\n", k, n))
|
||||||
case netmap.HomomorphicHashingDisabledKey, netmap.MaintenanceModeAllowedConfig:
|
case netmap.HomomorphicHashingDisabledKey, netmap.MaintenanceModeAllowedConfig:
|
||||||
|
|
|
@ -57,7 +57,7 @@ func DefaultRecordParser(key, value []byte) (common.SchemaEntry, common.Parser,
|
||||||
r.addr.SetContainer(cnr)
|
r.addr.SetContainer(cnr)
|
||||||
r.addr.SetObject(obj)
|
r.addr.SetObject(obj)
|
||||||
|
|
||||||
r.data = value[:]
|
r.data = value
|
||||||
|
|
||||||
return &r, nil, nil
|
return &r, nil, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -363,12 +363,12 @@ func (db *DB) deleteObject(
|
||||||
func parentLength(tx *bbolt.Tx, addr oid.Address) int {
|
func parentLength(tx *bbolt.Tx, addr oid.Address) int {
|
||||||
bucketName := make([]byte, bucketKeySize)
|
bucketName := make([]byte, bucketKeySize)
|
||||||
|
|
||||||
bkt := tx.Bucket(parentBucketName(addr.Container(), bucketName[:]))
|
bkt := tx.Bucket(parentBucketName(addr.Container(), bucketName))
|
||||||
if bkt == nil {
|
if bkt == nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
lst, err := decodeList(bkt.Get(objectKey(addr.Object(), bucketName[:])))
|
lst, err := decodeList(bkt.Get(objectKey(addr.Object(), bucketName)))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue