Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix miss makezero bug #4268

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion scripts/docker-integration-tests/query_fanout/restrict.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/services/m3comparator/main/parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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]))
}
Expand Down
2 changes: 1 addition & 1 deletion src/dbnode/integration/integration_data_verify.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
4 changes: 2 additions & 2 deletions src/query/api/v1/handler/prometheus/response.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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))
}
Expand Down