go-graphite / carbonapi

Empty slice literal used to declare a variable GO-W1027
Anti-pattern
Minor
8 days agoa year old
Empty slice literal of type "[]*gosnowth.DF4Response" used to define "responses"
338					zap.String("query", query),
339					zap.Any("tagMetrics", tagMetrics),
340				)
341				responses := []*gosnowth.DF4Response{}342				for _, metric := range tagMetrics.Items {
343					stats.RenderRequests++
344					res, err2 := c.client.FetchValues(&gosnowth.FetchQuery{
Empty slice literal of type "[]carbonapi_v3_pb.GlobMatch" used to define "globMatches"
111			})
112	} else {
113		for _, m := range query {
114			globMatches := []carbonapi_v3_pb.GlobMatch{}115			if response, ok := cfg.Expressions[m]; ok {
116				if response.ReplyDelayMS > 0 {
117					delay := time.Duration(response.ReplyDelayMS) * time.Millisecond
Empty slice literal of type "[]carbonapi_v3_pb.GlobMatch" used to define "globMatches"
 95			}
 96		}
 97
 98		globMatches := []carbonapi_v3_pb.GlobMatch{} 99		for k := range returnMap {
100			metricName := strings.Split(k, ".")
101
Empty slice literal of type "[]float64" used to define "e"
480
481// Vandermonde creates a Vandermonde matrix
482func Vandermonde(absent []float64, deg int) *mat.Dense {
483	e := []float64{}484	for i := range absent {
485		if math.IsNaN(absent[i]) {
486			continue