From 43c579f6704dd232294010536d54d83d8adde2f6 Mon Sep 17 00:00:00 2001 From: Alex Vanin Date: Mon, 11 Jan 2021 19:32:37 +0300 Subject: [PATCH] [#243] Fix ineffassign linter errors Signed-off-by: Alex Vanin --- v2/accounting/marshal.go | 2 +- v2/audit/marshal.go | 2 +- v2/netmap/marshal.go | 6 +++--- v2/object/marshal.go | 8 +++----- v2/storagegroup/marshal.go | 2 +- 5 files changed, 9 insertions(+), 11 deletions(-) diff --git a/v2/accounting/marshal.go b/v2/accounting/marshal.go index 684599f..e25ab90 100644 --- a/v2/accounting/marshal.go +++ b/v2/accounting/marshal.go @@ -36,7 +36,7 @@ func (d *Decimal) StableMarshal(buf []byte) ([]byte, error) { offset += n - n, err = protoutil.UInt32Marshal(decimalPrecisionField, buf[offset:], d.prec) + _, err = protoutil.UInt32Marshal(decimalPrecisionField, buf[offset:], d.prec) if err != nil { return nil, err } diff --git a/v2/audit/marshal.go b/v2/audit/marshal.go index f1a0c59..5ea8ef5 100644 --- a/v2/audit/marshal.go +++ b/v2/audit/marshal.go @@ -132,7 +132,7 @@ func (a *DataAuditResult) StableMarshal(buf []byte) ([]byte, error) { offset += n - n, err = proto.RepeatedBytesMarshal(failNodesFNum, buf[offset:], a.failNodes) + _, err = proto.RepeatedBytesMarshal(failNodesFNum, buf[offset:], a.failNodes) if err != nil { return nil, err } diff --git a/v2/netmap/marshal.go b/v2/netmap/marshal.go index b619628..32a6b76 100644 --- a/v2/netmap/marshal.go +++ b/v2/netmap/marshal.go @@ -159,7 +159,7 @@ func (s *Selector) StableMarshal(buf []byte) ([]byte, error) { offset += n - n, err = protoutil.StringMarshal(filterSelectorField, buf[offset:], s.filter) + _, err = protoutil.StringMarshal(filterSelectorField, buf[offset:], s.filter) if err != nil { return nil, err } @@ -209,7 +209,7 @@ func (r *Replica) StableMarshal(buf []byte) ([]byte, error) { offset += n - n, err = protoutil.StringMarshal(selectorReplicaField, buf[offset:], r.selector) + _, err = protoutil.StringMarshal(selectorReplicaField, buf[offset:], r.selector) if err != nil { return nil, err } @@ -418,7 +418,7 @@ func (ni *NodeInfo) StableMarshal(buf []byte) ([]byte, error) { offset += n } - n, err = protoutil.EnumMarshal(stateNodeInfoField, buf[offset:], int32(ni.state)) + _, err = protoutil.EnumMarshal(stateNodeInfoField, buf[offset:], int32(ni.state)) if err != nil { return nil, err } diff --git a/v2/object/marshal.go b/v2/object/marshal.go index 59ac0ad..b836d13 100644 --- a/v2/object/marshal.go +++ b/v2/object/marshal.go @@ -168,7 +168,7 @@ func (h *ShortHeader) StableMarshal(buf []byte) ([]byte, error) { offset += n - n, err = proto.NestedStructureMarshal(shortHdrHomoHashField, buf[offset:], h.homoHash) + _, err = proto.NestedStructureMarshal(shortHdrHomoHashField, buf[offset:], h.homoHash) if err != nil { return nil, err } @@ -485,13 +485,11 @@ func (h *HeaderWithSignature) StableMarshal(buf []byte) ([]byte, error) { offset += n - n, err = proto.NestedStructureMarshal(hdrWithSigSignatureField, buf[offset:], h.signature) + _, err = proto.NestedStructureMarshal(hdrWithSigSignatureField, buf[offset:], h.signature) if err != nil { return nil, err } - offset += n - return buf, nil } @@ -840,7 +838,7 @@ func (r *PutObjectPartInit) StableMarshal(buf []byte) ([]byte, error) { offset += n - n, err = proto.UInt32Marshal(putReqInitCopiesNumField, buf[offset:], r.copyNum) + _, err = proto.UInt32Marshal(putReqInitCopiesNumField, buf[offset:], r.copyNum) if err != nil { return nil, err } diff --git a/v2/storagegroup/marshal.go b/v2/storagegroup/marshal.go index c7d4e75..f7b1ed1 100644 --- a/v2/storagegroup/marshal.go +++ b/v2/storagegroup/marshal.go @@ -51,7 +51,7 @@ func (s *StorageGroup) StableMarshal(buf []byte) ([]byte, error) { offset += n - n, err = refs.ObjectIDNestedListMarshal(objectIDsField, buf[offset:], s.members) + _, err = refs.ObjectIDNestedListMarshal(objectIDsField, buf[offset:], s.members) if err != nil { return nil, err }