forked from TrueCloudLab/frostfs-node
[#1460] blobovnicza: Do not use pointers as the results
Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
parent
0e4a1beecf
commit
010253a97a
4 changed files with 12 additions and 12 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue