go-graphite / carbonapi

Go constants cannot express negative zero GO-W5009
Bug risk
Major
6 months ago2 years old
in Go, the floating-point literal '-0.0' is the same as '0.0', it does not produce a negative zero
139			},
140			[]*types.MetricData{
141				types.MakeMetricData("metric1 Current:0.00    Max:0.00   Min:-3.00",
142					[]float64{-1.0, -2.0, -1.0, -3.0, -1.0, -1.0, -0.0, -0.0, -0.0}, 1, now32).SetNameTag("metric1"),143			},
144		},
145		{
in Go, the floating-point literal '-0.0' is the same as '0.0', it does not produce a negative zero
139			},
140			[]*types.MetricData{
141				types.MakeMetricData("metric1 Current:0.00    Max:0.00   Min:-3.00",
142					[]float64{-1.0, -2.0, -1.0, -3.0, -1.0, -1.0, -0.0, -0.0, -0.0}, 1, now32).SetNameTag("metric1"),143			},
144		},
145		{
in Go, the floating-point literal '-0.0' is the same as '0.0', it does not produce a negative zero
139			},
140			[]*types.MetricData{
141				types.MakeMetricData("metric1 Current:0.00    Max:0.00   Min:-3.00",
142					[]float64{-1.0, -2.0, -1.0, -3.0, -1.0, -1.0, -0.0, -0.0, -0.0}, 1, now32).SetNameTag("metric1"),143			},
144		},
145		{
in Go, the floating-point literal '-0.0' is the same as '0.0', it does not produce a negative zero
134			map[parser.MetricRequest][]*types.MetricData{
135				{Metric: "metric1", From: 0, Until: 1}: {
136					types.MakeMetricData("metric1",
137						[]float64{-1.0, -2.0, -1.0, -3.0, -1.0, -1.0, -0.0, -0.0, -0.0}, 1, now32),138				},
139			},
140			[]*types.MetricData{
in Go, the floating-point literal '-0.0' is the same as '0.0', it does not produce a negative zero
134			map[parser.MetricRequest][]*types.MetricData{
135				{Metric: "metric1", From: 0, Until: 1}: {
136					types.MakeMetricData("metric1",
137						[]float64{-1.0, -2.0, -1.0, -3.0, -1.0, -1.0, -0.0, -0.0, -0.0}, 1, now32),138				},
139			},
140			[]*types.MetricData{