Skip to content

Commit 5b519f7

Browse files
Upgrade to go 1.25 (#77)
1 parent 325aeb4 commit 5b519f7

7 files changed

Lines changed: 103 additions & 90 deletions

File tree

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
check-latest: true
3030

3131
- name: golangci-lint
32-
uses: golangci/golangci-lint-action@4696ba8babb6127d732c3c6dde519db15edab9ea
32+
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9
3333
with:
3434
skip-save-cache: true
3535

.golangci.yml

Lines changed: 97 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,112 @@
1-
run:
2-
timeout: 5m
3-
1+
version: "2"
42
linters:
53
enable:
64
- bodyclose
75
- containedctx
8-
- gofmt
9-
- govet
10-
- ineffassign
6+
- exhaustive
7+
- gocritic
118
- misspell
9+
- nakedret
1210
- noctx
1311
- perfsprint
12+
- predeclared
13+
- revive
1414
- rowserrcheck
1515
- sloglint
1616
- sqlclosecheck
17-
- staticcheck
18-
- usetesting
1917
- unconvert
20-
- unused
21-
- gocritic
22-
- nakedret
23-
- predeclared
24-
- revive
25-
- exhaustive
18+
- usetesting
2619
disable:
2720
- errcheck
2821
- gosec
29-
- gosimple
30-
31-
linters-settings:
32-
errcheck:
33-
exclude-functions: [github.com/go-kit/kit/log:Log]
34-
gofmt:
35-
simplify: false
36-
gocritic:
37-
disabled-checks:
38-
- ifElseChain
39-
- elseif
40-
sloglint:
41-
kv-only: true
42-
context: "all"
43-
key-naming-case: snake
44-
static-msg: true
45-
revive:
22+
settings:
23+
errcheck:
24+
exclude-functions:
25+
- github.com/go-kit/kit/log:Log
26+
gocritic:
27+
disabled-checks:
28+
- ifElseChain
29+
- elseif
30+
revive:
31+
rules:
32+
- name: superfluous-else
33+
arguments:
34+
- preserveScope
35+
severity: warning
36+
disabled: false
37+
- name: package-comments
38+
disabled: false
39+
- name: context-as-argument
40+
disabled: false
41+
- name: context-keys-type
42+
disabled: false
43+
- name: error-return
44+
disabled: false
45+
- name: errorf
46+
disabled: false
47+
- name: unreachable-code
48+
disabled: false
49+
- name: early-return
50+
disabled: false
51+
- name: confusing-naming
52+
disabled: false
53+
- name: defer
54+
disabled: false
55+
sloglint:
56+
kv-only: true
57+
context: all
58+
static-msg: true
59+
key-naming-case: snake
60+
staticcheck:
61+
checks:
62+
- all
63+
exclusions:
64+
generated: lax
65+
presets:
66+
- comments
67+
- common-false-positives
68+
- legacy
69+
- std-error-handling
4670
rules:
47-
- name: superfluous-else
48-
severity: warning
49-
disabled: false
50-
arguments:
51-
- "preserveScope"
52-
- name: package-comments
53-
disabled: false
54-
- name: context-as-argument
55-
disabled: false
56-
- name: context-keys-type
57-
disabled: false
58-
- name: error-return
59-
disabled: false
60-
- name: errorf
61-
disabled: false
62-
- name: unreachable-code
63-
disabled: false
64-
- name: early-return
65-
disabled: false
66-
- name: confusing-naming
67-
disabled: false
68-
- name: defer
69-
disabled: false
70-
staticcheck:
71-
checks: ["all"]
72-
73-
issues:
74-
exclude-rules:
75-
# False positive: https://github.com/kunwardeep/paralleltest/issues/8.
76-
- linters:
77-
- paralleltest
78-
text: "does not use range value in test Run"
79-
# We prefer fmt.Sprintf over string concatenation for readability
80-
- linters: [perfsprint]
81-
text: "fmt.Sprintf can be replaced with string concatenation"
82-
- linters: [perfsprint]
83-
text: "fmt.Sprintf can be replaced with faster hex.EncodeToString"
84-
- linters: [perfsprint]
85-
text: "fmt.Sprintf can be replaced with faster strconv.FormatBool"
86-
- linters: [perfsprint]
87-
text: "fmt.Sprintf can be replaced with faster strconv.FormatInt"
88-
- linters: [perfsprint]
89-
text: "fmt.Sprintf can be replaced with faster strconv.FormatUint"
90-
- linters: [perfsprint]
91-
text: "fmt.Sprintf can be replaced with faster strconv.Itoa"
92-
- linters: [perfsprint]
93-
text: "fmt.Sprint can be replaced with faster strconv.Itoa"
94-
exclude-dirs:
95-
- test-cmds
71+
- linters:
72+
- paralleltest
73+
text: does not use range value in test Run
74+
- linters:
75+
- perfsprint
76+
text: fmt.Sprintf can be replaced with string concatenation
77+
- linters:
78+
- perfsprint
79+
text: fmt.Sprintf can be replaced with faster hex.EncodeToString
80+
- linters:
81+
- perfsprint
82+
text: fmt.Sprintf can be replaced with faster strconv.FormatBool
83+
- linters:
84+
- perfsprint
85+
text: fmt.Sprintf can be replaced with faster strconv.FormatInt
86+
- linters:
87+
- perfsprint
88+
text: fmt.Sprintf can be replaced with faster strconv.FormatUint
89+
- linters:
90+
- perfsprint
91+
text: fmt.Sprintf can be replaced with faster strconv.Itoa
92+
- linters:
93+
- perfsprint
94+
text: fmt.Sprint can be replaced with faster strconv.Itoa
95+
paths:
96+
- test-cmds
97+
- third_party$
98+
- builtin$
99+
- examples$
100+
formatters:
101+
enable:
102+
- gofmt
103+
settings:
104+
gofmt:
105+
simplify: false
106+
exclusions:
107+
generated: lax
108+
paths:
109+
- test-cmds
110+
- third_party$
111+
- builtin$
112+
- examples$

dbutil/dbutil.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ func OpenDB(driver, dsn string, opts ...Option) (*sql.DB, error) {
8888

8989
var dbError error
9090
for attempt := 0; attempt < config.maxAttempts; attempt++ {
91-
dbError = db.Ping()
91+
dbError = db.Ping() //nolint:noctx
9292
if dbError == nil {
9393
// we're connected!
9494
break

debug/debug.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ func StartServer(opts ...Option) (*Server, error) {
8282
}
8383

8484
func (s *Server) Start() error {
85-
l, err := net.Listen("tcp", s.addr)
85+
l, err := net.Listen("tcp", s.addr) //nolint:noctx
8686
if err != nil {
8787
return errors.Wrap(err, "opening socket")
8888
}

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/kolide/kit
22

3-
go 1.24.0
3+
go 1.25.0
44

55
require (
66
github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc

health/health_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func TestHealthzHandler(t *testing.T) {
6262
t.Parallel()
6363

6464
rr := httptest.NewRecorder()
65-
req := httptest.NewRequest("GET", "/healthz", nil)
65+
req := httptest.NewRequestWithContext(t.Context(), "GET", "/healthz", nil)
6666
tt.handler.ServeHTTP(rr, req)
6767
assert.Equal(t, rr.Code, tt.wantHeader)
6868
})

munemo/munemo.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -116,11 +116,7 @@ func (m *munemo) decode(s string) error {
116116

117117
// As long as there are characters, parse them
118118
// Read the first syllable, interpret, remove.
119-
for {
120-
if s == "" {
121-
break
122-
}
123-
119+
for s != "" {
124120
// Syllables are 2 or 3 letters. Check to see if the first 2 or 3
125121
// characters are in our array of syllables.
126122
if val, ok := m.symbolValues[s[0:2]]; ok {

0 commit comments

Comments
 (0)