Skip to content

Commit 1b6926f

Browse files
Use golangci-lint 2.x (#195)
Signed-off-by: Pulok Saha <[email protected]>
1 parent 1fbc8c5 commit 1b6926f

7 files changed

Lines changed: 34 additions & 51 deletions

File tree

.golangci.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
version: "2"
2+
linters:
3+
default: standard
4+
enable:
5+
- unparam
6+
7+
formatters:
8+
enable:
9+
- gofmt
10+
- goimports
11+
settings:
12+
gofmt:
13+
rewrite-rules:
14+
- pattern: 'interface{}'
15+
replacement: 'any'
16+
17+
issues:
18+
max-same-issues: 100
19+
20+
exclude-files:
21+
- generated.*\\.go
22+
23+
exclude-dirs:
24+
- client
25+
- vendor
26+
27+
run:
28+
timeout: 10m

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ lint: $(BUILD_DIRS)
282282
--env GO111MODULE=on \
283283
--env GOFLAGS="-mod=vendor" \
284284
$(BUILD_IMAGE) \
285-
golangci-lint run --enable $(ADDTL_LINTERS) --timeout=30m --exclude-files="generated.*\.go$\" --exclude-dirs-use-default --exclude-dirs=client,vendor
285+
golangci-lint run
286286

287287
$(BUILD_DIRS):
288288
@mkdir -p $@

go.mod

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
module stash.appscode.dev/nats
22

3-
go 1.23.0
4-
5-
toolchain go1.24.4
3+
go 1.25.5
64

75
require (
86
github.com/spf13/cobra v1.8.0

lintconf.yaml

Lines changed: 0 additions & 43 deletions
This file was deleted.

pkg/backup.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ func (opt *natsOptions) writeStreamNamesToFile(sh *shell.Session) error {
305305
}
306306

307307
func (opt *natsOptions) writeAll(sh *shell.Session) error {
308-
args := []interface{}{
308+
args := []any{
309309
"stream",
310310
"ls",
311311
"--json",

pkg/restore.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ func (opt *natsOptions) restoreNATS(targetRef api_v1beta1.TargetRef) (*restic.Re
244244
}
245245

246246
func removeMatchedStreams(sh *shell.Session, streams []string) error {
247-
lsArgs := []interface{}{
247+
lsArgs := []any{
248248
"stream",
249249
"ls",
250250
"--json",
@@ -257,7 +257,7 @@ func removeMatchedStreams(sh *shell.Session, streams []string) error {
257257
if err := json.Unmarshal(byteStreams, &currStreams); err != nil {
258258
return err
259259
}
260-
rmArgs := []interface{}{
260+
rmArgs := []any{
261261
"stream",
262262
"rm",
263263
"-f",

pkg/util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ func clearDir(dir string) error {
201201
func (session sessionWrapper) waitForNATSReady(warningThreshold string) error {
202202
klog.Infoln("Waiting for the nats server to be ready...")
203203

204-
args := []interface{}{
204+
args := []any{
205205
"server",
206206
"check",
207207
"connection",

0 commit comments

Comments
 (0)