Skip to content

Commit c3fd3c6

Browse files
authored
Bumb to go 1.24 (#166)
* Bumb to go 1.24 Signed-off-by: Friedrich Gonzalez <[email protected]> * Upgrade golangci-lint like #159 Signed-off-by: Friedrich Gonzalez <[email protected]> * Convert to switch Signed-off-by: Friedrich Gonzalez <[email protected]> --------- Signed-off-by: Friedrich Gonzalez <[email protected]>
1 parent 17eec60 commit c3fd3c6

File tree

4 files changed

+31
-12
lines changed

4 files changed

+31
-12
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,4 @@ jobs:
3232
go-version-file: .go-version
3333
cache: true
3434
- name: Golangci-lint
35-
uses: golangci/golangci-lint-action@v6.5.1
35+
uses: golangci/golangci-lint-action@v8.0.0

.go-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.22
1+
1.24

.golangci.yml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
1+
version: "2"
12
linters:
23
enable:
3-
- goimports
44
- misspell
55
- revive
6-
7-
issues:
8-
exclude-rules:
9-
- path: _test.go
10-
linters:
11-
- errcheck
6+
exclusions:
7+
generated: lax
8+
presets:
9+
- comments
10+
- common-false-positives
11+
- legacy
12+
- std-error-handling
13+
rules:
14+
- linters:
15+
- errcheck
16+
path: _test.go
17+
paths:
18+
- third_party$
19+
- builtin$
20+
- examples$
21+
formatters:
22+
enable:
23+
- goimports
24+
exclusions:
25+
generated: lax
26+
paths:
27+
- third_party$
28+
- builtin$
29+
- examples$

walk.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -356,13 +356,14 @@ func (s *PromQLSmith) walkFunctions(expr *parser.Call, depth int) {
356356
}
357357

358358
expr.Args = make([]parser.Expr, len(expr.Func.ArgTypes))
359-
if expr.Func.Name == "holt_winters" {
359+
switch expr.Func.Name {
360+
case "holt_winters":
360361
s.walkHoltWinters(expr, depth)
361362
return
362-
} else if expr.Func.Name == "label_replace" {
363+
case "label_replace":
363364
s.walkLabelReplace(expr, depth)
364365
return
365-
} else if expr.Func.Name == "info" {
366+
case "info":
366367
s.walkInfo(expr, depth)
367368
return
368369
}

0 commit comments

Comments
 (0)