From 7d84d104fb6088fcffc4d49c2a46b3d9f69cb130 Mon Sep 17 00:00:00 2001 From: Aleksey Savchuk Date: Mon, 9 Sep 2024 11:43:00 +0300 Subject: [PATCH] [#260] *: Fix linter warnings Signed-off-by: Aleksey Savchuk --- pool/tree/pool.go | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pool/tree/pool.go b/pool/tree/pool.go index 3b0ff1a..0d7c117 100644 --- a/pool/tree/pool.go +++ b/pool/tree/pool.go @@ -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.