Commit b609d811 by Mario Trangoni

pkg/tsdb/elasticsearch/client/search_request.go: simplify loop with

append.

$ gometalinter --vendor --disable-all --enable=megacheck --disable=gotype --deadline=6m ./...
pkg/tsdb/elasticsearch/client/search_request.go:59:4:warning: should replace loop with sr.Aggs = append(sr.Aggs, aggArray...) (S1011) (megacheck)
pkg/tsdb/elasticsearch/client/search_request.go:303:4:warning: should replace loop with agg.Aggregation.Aggs = append(agg.Aggregation.Aggs, childAggs...) (S1011) (megacheck)
parent a6c438c8
......@@ -56,9 +56,7 @@ func (b *SearchRequestBuilder) Build() (*SearchRequest, error) {
if err != nil {
return nil, err
}
for _, agg := range aggArray {
sr.Aggs = append(sr.Aggs, agg)
}
sr.Aggs = append(sr.Aggs, aggArray...)
}
}
......@@ -300,9 +298,7 @@ func (b *aggBuilderImpl) Build() (AggArray, error) {
return nil, err
}
for _, childAgg := range childAggs {
agg.Aggregation.Aggs = append(agg.Aggregation.Aggs, childAgg)
}
agg.Aggregation.Aggs = append(agg.Aggregation.Aggs, childAggs...)
}
aggs = append(aggs, agg)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment