util/proto: do not return error from primitive marshalers

Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
Evgenii Stratonikov 2022-03-12 15:20:19 +03:00 committed by LeL
parent 732dd51b1b
commit 84d981e88e
14 changed files with 202 additions and 932 deletions

View file

@ -30,12 +30,7 @@ func (s *StorageGroup) StableMarshal(buf []byte) ([]byte, error) {
err error
)
n, err = proto.UInt64Marshal(sizeField, buf[offset:], s.size)
if err != nil {
return nil, err
}
offset += n
offset += proto.UInt64Marshal(sizeField, buf[offset:], s.size)
n, err = proto.NestedStructureMarshal(hashField, buf[offset:], s.hash)
if err != nil {
@ -44,12 +39,7 @@ func (s *StorageGroup) StableMarshal(buf []byte) ([]byte, error) {
offset += n
n, err = proto.UInt64Marshal(expirationField, buf[offset:], s.exp)
if err != nil {
return nil, err
}
offset += n
offset += proto.UInt64Marshal(expirationField, buf[offset:], s.exp)
_, err = refs.ObjectIDNestedListMarshal(objectIDsField, buf[offset:], s.members)
if err != nil {