[#1460] blobovnicza: Do not use pointers as the results

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-05-31 15:22:32 +03:00 committed by Pavel Karpy
parent 0e4a1beecf
commit 010253a97a
4 changed files with 12 additions and 12 deletions

View file

@ -35,7 +35,7 @@ func (p GetRes) Object() []byte {
//
// Returns an error of type apistatus.ObjectNotFound if the requested object is not
// presented in Blobovnicza.
func (b *Blobovnicza) Get(prm GetPrm) (*GetRes, error) {
func (b *Blobovnicza) Get(prm GetPrm) (GetRes, error) {
var (
data []byte
addrKey = addressKey(prm.addr)
@ -58,16 +58,16 @@ func (b *Blobovnicza) Get(prm GetPrm) (*GetRes, error) {
return stop, nil
})
}); err != nil {
return nil, err
return GetRes{}, err
}
if data == nil {
var errNotFound apistatus.ObjectNotFound
return nil, errNotFound
return GetRes{}, errNotFound
}
return &GetRes{
return GetRes{
obj: data,
}, nil
}