Skip to content

Commit f003307

Browse files
committed
Fix lint issues
Signed-off-by: Friedrich Gonzalez <1517449+friedrichg@users.noreply.github.com>
1 parent 11d1c8f commit f003307

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

cmd/sim/main.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ func run(k int, sizer func(float64) int) {
116116

117117
fmt.Printf("%d, %d, %d, %d, %f, %f\n",
118118
k,
119-
int(min(nodeSeries)),
120-
int(max(nodeSeries)),
119+
int(minFloat(nodeSeries)),
120+
int(maxFloat(nodeSeries)),
121121
int(stat.Mean(nodeSeries, nil)),
122122
stat.StdDev(nodeSeries, nil),
123123
float64(maxAffectedTenants)/float64(numTenants))
@@ -168,7 +168,7 @@ func shuffleShard(entropy *rand.Rand, shardSize, numReplicas int) []int {
168168
return ids
169169
}
170170

171-
func min(fs []float64) float64 {
171+
func minFloat(fs []float64) float64 {
172172
result := math.MaxFloat64
173173
for _, f := range fs {
174174
if f < result {
@@ -178,7 +178,7 @@ func min(fs []float64) float64 {
178178
return result
179179
}
180180

181-
func max(fs []float64) float64 {
181+
func maxFloat(fs []float64) float64 {
182182
result := 0.0
183183
for _, f := range fs {
184184
if f > result {

pkg/alerting/receiver.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ func (r *Receiver) measureLatency(w http.ResponseWriter, req *http.Request) {
116116

117117
if err := json.NewDecoder(req.Body).Decode(&data); err != nil {
118118
w.WriteHeader(http.StatusBadRequest)
119-
level.Error(r.logger).Log("msg", "unable to parse alerts", "err", err)
119+
_ = level.Error(r.logger).Log("msg", "unable to parse alerts", "err", err)
120120
r.failedEvalTotal.Inc()
121121
return
122122
}
@@ -133,7 +133,7 @@ func (r *Receiver) measureLatency(w http.ResponseWriter, req *http.Request) {
133133
}
134134

135135
if name == "" {
136-
level.Debug(r.logger).Log("err", "alerts does not have an alertname label - we can't measure it", "labels", alert.Labels.Names())
136+
_ = level.Debug(r.logger).Log("err", "alerts does not have an alertname label - we can't measure it", "labels", alert.Labels.Names())
137137
continue
138138
}
139139

@@ -145,7 +145,7 @@ func (r *Receiver) measureLatency(w http.ResponseWriter, req *http.Request) {
145145

146146
timestamp, err := strconv.ParseFloat(v, 64)
147147
if err != nil {
148-
level.Error(r.logger).Log("msg", "failed to parse the timestamp of the alert", "alert", name)
148+
_ = level.Error(r.logger).Log("msg", "failed to parse the timestamp of the alert", "alert", name)
149149
r.failedEvalTotal.Inc()
150150
continue
151151
}

pkg/rules/compare.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,9 +131,9 @@ func rulesEqual(a, b *rulefmt.RuleNode) bool {
131131

132132
// CompareNamespaces returns the differences between the two provided
133133
// namespaces
134-
func CompareNamespaces(original, new RuleNamespace) NamespaceChange {
134+
func CompareNamespaces(original, updated RuleNamespace) NamespaceChange {
135135
result := NamespaceChange{
136-
Namespace: new.Namespace,
136+
Namespace: updated.Namespace,
137137
State: Unchanged,
138138
GroupsUpdated: []UpdatedRuleGroup{},
139139
GroupsCreated: []rwrulefmt.RuleGroup{},
@@ -145,7 +145,7 @@ func CompareNamespaces(original, new RuleNamespace) NamespaceChange {
145145
origMap[g.Name] = g
146146
}
147147

148-
for _, newGroup := range new.Groups {
148+
for _, newGroup := range updated.Groups {
149149
origGroup, found := origMap[newGroup.Name]
150150
if !found {
151151
result.State = Updated

0 commit comments

Comments
 (0)