Skip to content

Commit 5e8f871

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

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

.golangci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ linters:
1818

1919
linters-settings:
2020
errcheck:
21-
exclude-functions: []
21+
exclude-functions:
22+
- (github.com/go-kit/log.Logger).Log
2223
goimports:
2324
local-prefixes: "github.com/cortexproject/cortex-tools"

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/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)