[#857] golangci: Add protogetter linter
All checks were successful
DCO action / DCO (pull_request) Successful in 1m38s
Vulncheck / Vulncheck (pull_request) Successful in 3m2s
Build / Build Components (1.21) (pull_request) Successful in 3m51s
Build / Build Components (1.20) (pull_request) Successful in 4m3s
Tests and linters / Staticcheck (pull_request) Successful in 5m17s
Tests and linters / Lint (pull_request) Successful in 6m11s
Tests and linters / Tests (1.20) (pull_request) Successful in 11m7s
Tests and linters / Tests (1.21) (pull_request) Successful in 11m32s
Tests and linters / Tests with -race (pull_request) Successful in 12m22s
All checks were successful
DCO action / DCO (pull_request) Successful in 1m38s
Vulncheck / Vulncheck (pull_request) Successful in 3m2s
Build / Build Components (1.21) (pull_request) Successful in 3m51s
Build / Build Components (1.20) (pull_request) Successful in 4m3s
Tests and linters / Staticcheck (pull_request) Successful in 5m17s
Tests and linters / Lint (pull_request) Successful in 6m11s
Tests and linters / Tests (1.20) (pull_request) Successful in 11m7s
Tests and linters / Tests (1.21) (pull_request) Successful in 11m32s
Tests and linters / Tests with -race (pull_request) Successful in 12m22s
Signed-off-by: Dmitrii Stepanov <d.stepanov@yadro.com>
This commit is contained in:
parent
94ffe8bb45
commit
11add38e87
10 changed files with 25 additions and 22 deletions
|
@ -369,13 +369,14 @@ func (s *Service) GetNodeByPath(ctx context.Context, req *GetNodeByPathRequest)
|
|||
x.ParentId = parent
|
||||
x.NodeId = node
|
||||
x.Timestamp = m.Time
|
||||
if b.AllAttributes {
|
||||
if b.GetAllAttributes() {
|
||||
x.Meta = metaToProto(m.Items)
|
||||
} else {
|
||||
var metaValue []*KeyValue
|
||||
for _, kv := range m.Items {
|
||||
for _, attr := range b.GetAttributes() {
|
||||
if kv.Key == attr {
|
||||
x.Meta = append(x.Meta, &KeyValue{
|
||||
metaValue = append(metaValue, &KeyValue{
|
||||
Key: kv.Key,
|
||||
Value: kv.Value,
|
||||
})
|
||||
|
@ -383,6 +384,7 @@ func (s *Service) GetNodeByPath(ctx context.Context, req *GetNodeByPathRequest)
|
|||
}
|
||||
}
|
||||
}
|
||||
x.Meta = metaValue
|
||||
}
|
||||
info = append(info, &x)
|
||||
}
|
||||
|
@ -670,8 +672,8 @@ func protoToMeta(arr []*KeyValue) []pilorama.KeyValue {
|
|||
meta := make([]pilorama.KeyValue, len(arr))
|
||||
for i, kv := range arr {
|
||||
if kv != nil {
|
||||
meta[i].Key = kv.Key
|
||||
meta[i].Value = kv.Value
|
||||
meta[i].Key = kv.GetKey()
|
||||
meta[i].Value = kv.GetValue()
|
||||
}
|
||||
}
|
||||
return meta
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue