[#260] *: Fix linter warnings

Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
This commit is contained in:
Aleksey Savchuk 2024-09-09 11:43:00 +03:00
parent 812126a8ff
commit 7d84d104fb

View file

@ -360,7 +360,7 @@ func (p *Pool) GetNodes(ctx context.Context, prm GetNodesParams) ([]*grpcService
// Empty result is expected due to delayed tree service sync.
// Return an error there to trigger retry and ignore it after,
// to keep compatibility with 'GetNodeByPath' implementation.
if inErr == nil && len(resp.Body.Nodes) == 0 {
if inErr == nil && len(resp.GetBody().GetNodes()) == 0 {
return errNodeEmptyResult
}
return handleError("failed to get node by path", inErr)
@ -389,7 +389,7 @@ func (x *SubTreeReader) Read(buf []*grpcService.GetSubTreeResponse_Body) (int, e
} else if err != nil {
return i, handleError("failed to get sub tree", err)
}
buf[i] = resp.Body
buf[i] = resp.GetBody()
}
return len(buf), nil
@ -405,7 +405,7 @@ func (x *SubTreeReader) ReadAll() ([]*grpcService.GetSubTreeResponse_Body, error
} else if err != nil {
return nil, handleError("failed to get sub tree", err)
}
res = append(res, resp.Body)
res = append(res, resp.GetBody())
}
return res, nil
@ -421,7 +421,7 @@ func (x *SubTreeReader) Next() (*grpcService.GetSubTreeResponse_Body, error) {
return nil, handleError("failed to get sub tree", err)
}
return resp.Body, nil
return resp.GetBody(), nil
}
// GetSubTree invokes eponymous method from TreeServiceClient.
@ -535,12 +535,12 @@ func (p *Pool) AddNodeByPath(ctx context.Context, prm AddNodeByPathParams) (uint
body := resp.GetBody()
if body == nil {
return 0, errors.New("nil body in tree service response")
} else if len(body.Nodes) == 0 {
} else if len(body.GetNodes()) == 0 {
return 0, errors.New("empty list of added nodes in tree service response")
}
// The first node is the leaf that we add, according to tree service docs.
return body.Nodes[0], nil
return body.GetNodes()[0], nil
}
// MoveNode invokes eponymous method from TreeServiceClient.