diff --git a/scripts/docker-integration-tests/query_fanout/restrict.go b/scripts/docker-integration-tests/query_fanout/restrict.go index 8f2bb7f8ee..906a89f38c 100644 --- a/scripts/docker-integration-tests/query_fanout/restrict.go +++ b/scripts/docker-integration-tests/query_fanout/restrict.go @@ -325,7 +325,7 @@ type values []value type value []interface{} func (r *result) genID() result { - tags := make(sort.StringSlice, len(r.Metric)) + tags := make(sort.StringSlice, 0, len(r.Metric)) for k, v := range r.Metric { tags = append(tags, fmt.Sprintf("%s:%s,", k, v)) } diff --git a/src/cmd/services/m3comparator/main/parser/parser.go b/src/cmd/services/m3comparator/main/parser/parser.go index 1c5902b30d..a40110e00d 100644 --- a/src/cmd/services/m3comparator/main/parser/parser.go +++ b/src/cmd/services/m3comparator/main/parser/parser.go @@ -112,7 +112,7 @@ func (v *Value) UnmarshalJSON(data []byte) error { // IDOrGenID gets the ID for this result. func (r *Series) IDOrGenID() string { if len(r.id) == 0 { - tags := make(sort.StringSlice, len(r.Tags)) + tags := make(sort.StringSlice, 0, len(r.Tags)) for _, v := range r.Tags { tags = append(tags, fmt.Sprintf("%s:%s,", v[0], v[1])) } diff --git a/src/dbnode/integration/integration_data_verify.go b/src/dbnode/integration/integration_data_verify.go index 819a9d0a0d..58e800db8b 100644 --- a/src/dbnode/integration/integration_data_verify.go +++ b/src/dbnode/integration/integration_data_verify.go @@ -236,7 +236,7 @@ func writeVerifyDebugOutput( list := make(readableSeriesList, 0, len(series)) for i := range series { - tags := make([]readableSeriesTag, len(series[i].Tags.Values())) + tags := make([]readableSeriesTag, 0, len(series[i].Tags.Values())) for _, tag := range series[i].Tags.Values() { tags = append(tags, readableSeriesTag{ Name: tag.Name.String(), diff --git a/src/query/api/v1/handler/prometheus/response.go b/src/query/api/v1/handler/prometheus/response.go index a28384e162..badffdd50e 100644 --- a/src/query/api/v1/handler/prometheus/response.go +++ b/src/query/api/v1/handler/prometheus/response.go @@ -41,7 +41,7 @@ type data struct { // ResultType is the type of Result (matrix, vector, etc.). ResultType string // Result contains the query result (concrete type depends on ResultType). - Result result + Result result } type result interface { @@ -169,7 +169,7 @@ type Values []Value type Value []interface{} func (t *Tags) genID() string { - tags := make(sort.StringSlice, len(*t)) + tags := make(sort.StringSlice, 0, len(*t)) for k, v := range *t { tags = append(tags, fmt.Sprintf("%s:%s,", k, v)) }