util/proto: do not return error from primitive marshalers
Signed-off-by: Evgenii Stratonikov <evgeniy@nspcc.ru>
This commit is contained in:
parent
732dd51b1b
commit
84d981e88e
14 changed files with 202 additions and 932 deletions
|
@ -24,22 +24,10 @@ func (d *Decimal) StableMarshal(buf []byte) ([]byte, error) {
|
|||
buf = make([]byte, d.StableSize())
|
||||
}
|
||||
|
||||
var (
|
||||
offset, n int
|
||||
err error
|
||||
)
|
||||
var offset int
|
||||
|
||||
n, err = protoutil.Int64Marshal(decimalValueField, buf[offset:], d.val)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
offset += n
|
||||
|
||||
_, err = protoutil.UInt32Marshal(decimalPrecisionField, buf[offset:], d.prec)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
offset += protoutil.Int64Marshal(decimalValueField, buf[offset:], d.val)
|
||||
protoutil.UInt32Marshal(decimalPrecisionField, buf[offset:], d.prec)
|
||||
|
||||
return buf, nil
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue