diff --git a/v2/accounting/marshal.go b/v2/accounting/marshal.go index 684599f9..e25ab909 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 f1a0c599..5ea8ef51 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 b619628e..32a6b767 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 59ac0ad9..b836d135 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 c7d4e75a..f7b1ed15 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 }