Skip to content

Commit 119e346

Browse files
committed
lint and gosimple fixes
1 parent 6ea1863 commit 119e346

File tree

3 files changed

+179
-179
lines changed

3 files changed

+179
-179
lines changed

expr/expr.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2049,7 +2049,7 @@ func EvalExpr(e *expr, from, until int32, values map[MetricRequest][]*MetricData
20492049
return nil, err
20502050
}
20512051

2052-
var offset int = 0
2052+
var offset int
20532053

20542054
if scaleByStep {
20552055
windowSize /= int(arg[0].GetStepTime())
@@ -2699,11 +2699,11 @@ func EvalExpr(e *expr, from, until int32, values map[MetricRequest][]*MetricData
26992699
return nil, errors.New("degree must be larger or equal to 1")
27002700
}
27012701

2702-
offs_str, err := getStringNamedOrPosArgDefault(e, "offset", 2, "0d")
2702+
offsStr, err := getStringNamedOrPosArgDefault(e, "offset", 2, "0d")
27032703
if err != nil {
27042704
return nil, err
27052705
}
2706-
offs, err := IntervalString(offs_str, 1)
2706+
offs, err := IntervalString(offsStr, 1)
27072707
if err != nil {
27082708
return nil, err
27092709
}
@@ -2726,13 +2726,13 @@ func EvalExpr(e *expr, from, until int32, values map[MetricRequest][]*MetricData
27262726

27272727
// Removing absent values from original dataset
27282728
nonNulls := make([]float64, 0)
2729-
for i, _ := range a.Values {
2729+
for i := range a.Values {
27302730
if !a.IsAbsent[i] {
27312731
nonNulls = append(nonNulls, a.Values[i])
27322732
}
27332733
}
27342734
if len(nonNulls) < 2 {
2735-
for i, _ := range r.IsAbsent {
2735+
for i := range r.IsAbsent {
27362736
r.IsAbsent[i] = true
27372737
}
27382738
results = append(results, &r)
@@ -2754,7 +2754,7 @@ func EvalExpr(e *expr, from, until int32, values map[MetricRequest][]*MetricData
27542754
c.Product(&i, v.T(), mat64.NewDense(len(nonNulls), 1, nonNulls))
27552755
// END OF STEPS
27562756

2757-
for i, _ := range r.Values {
2757+
for i := range r.Values {
27582758
r.Values[i] = poly(float64(i), c.RawMatrix().Data...)
27592759
}
27602760
results = append(results, &r)
@@ -3344,7 +3344,7 @@ func EvalExpr(e *expr, from, until int32, values map[MetricRequest][]*MetricData
33443344
series := arg.Values[windowPoints:]
33453345
absent := arg.IsAbsent[windowPoints:]
33463346

3347-
for i, _ := range series {
3347+
for i := range series {
33483348
if absent[i] {
33493349
aberration = append(aberration, 0)
33503350
} else if !math.IsNaN(upperBand[i]) && series[i] > upperBand[i] {
@@ -3943,7 +3943,7 @@ func varianceValue(f64s []float64, absent []bool) float64 {
39433943
// Create a Vandermonde matrix
39443944
func vandermonde(absent []bool, deg int) *mat64.Dense {
39453945
e := []float64{}
3946-
for i, _ := range absent {
3946+
for i := range absent {
39473947
if absent[i] {
39483948
continue
39493949
}

0 commit comments

Comments
 (0)