Skip to content

Commit 518e8ac

Browse files
committed
Revert "CLOUDP-300869: Upgrade golangci to v1.64.5 (#3656)"
This reverts commit df33d20.
1 parent d6ef35f commit 518e8ac

36 files changed

+102
-72
lines changed

.github/workflows/code-health.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ jobs:
2525
- name: golangci-lint
2626
uses: golangci/golangci-lint-action@2226d7cb06a077cd73e56eedd38eecad18e5d837
2727
with:
28-
version: v1.64.5
28+
version: v1.61.0
2929
unit-tests:
3030
env:
3131
COVERAGE: coverage.out

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,14 +119,14 @@ linters:
119119
- rowserrcheck # checks whether Err of rows is checked successfully [fast: false, auto-fix: false]
120120
- staticcheck # (megacheck) It's a set of rules from staticcheck. It's not the same thing as the staticcheck binary. The author of staticcheck doesn't support or approve the use of staticcheck as a library inside golangci-lint. [fast: false, auto-fix: false]
121121
- stylecheck # Stylecheck is a replacement for golint [fast: false, auto-fix: false]
122+
- tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17 [fast: false, auto-fix: false]
122123
- testableexamples # linter checks if examples are testable (have an expected output)
123124
- testifylint # Checks usage of github.com/stretchr/testify. [fast: false, auto-fix: false]
124125
- thelper # thelper detects golang test helpers without t.Helper() call and checks the consistency of test helpers [fast: false, auto-fix: false]
125126
- typecheck # Like the front-end of a Go compiler, parses and type-checks Go code [fast: false, auto-fix: false]
126127
- unconvert # Remove unnecessary type conversions [fast: false, auto-fix: false]
127128
- unparam # Reports unused function parameters [fast: false, auto-fix: false]
128129
- unused # (megacheck) Checks Go code for unused constants, variables, functions and types [fast: false, auto-fix: false]
129-
- usetesting # Reports uses of functions with replacement inside the testing package.
130130
- usestdlibvars # A linter that detect the possibility to use variables/constants from the Go standard library. [fast: true, auto-fix: false]
131131
- wastedassign # wastedassign finds wasted assignment statements. [fast: false, auto-fix: false]
132132
- whitespace # Tool for detection of leading and trailing whitespace [fast: true, auto-fix: true]

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# A Self-Documenting Makefile: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
22

3-
GOLANGCI_VERSION=v1.64.5
3+
GOLANGCI_VERSION=v1.61.0
44
COVERAGE?=coverage.out
55
GOCOVERDIR?=$(abspath cov)
66

build/ci/evergreen.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ include:
2121

2222
variables:
2323
- &go_linux_version
24-
go_root: "/opt/golang/go1.24"
25-
go_bin: "/opt/golang/go1.24/bin"
24+
go_root: "/opt/golang/go1.23"
25+
go_bin: "/opt/golang/go1.23/bin"
2626
go_base_path: ""
2727
- &go_env
2828
XDG_CONFIG_HOME: ${go_base_path}${workdir}

go.mod

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

3-
go 1.24.0
3+
go 1.23.6
44

55
require (
66
cloud.google.com/go/kms v1.20.5

internal/api/watcher_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,7 @@ func TestWatchInner(t *testing.T) {
457457

458458
for _, tt := range tests {
459459
t.Run(tt.name, func(t *testing.T) {
460-
ctx := t.Context()
460+
ctx := context.Background()
461461
result, err := watchInner(ctx, tt.executor, tt.expect, tt.commandRequest)
462462

463463
// Check error

internal/cli/auth/login_test.go

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

1919
import (
2020
"bytes"
21+
"context"
2122
"errors"
2223
"fmt"
2324
"testing"
@@ -88,7 +89,7 @@ func Test_loginOpts_Run(t *testing.T) {
8889
ExpiresIn: 300,
8990
Interval: 10,
9091
}
91-
ctx := t.Context()
92+
ctx := context.TODO()
9293
mockFlow.
9394
EXPECT().
9495
RequestCode(ctx).

internal/cli/auth/logout_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ package auth
1818

1919
import (
2020
"bytes"
21+
"context"
2122
"testing"
2223

2324
"github.com/golang/mock/gomock"
@@ -41,7 +42,7 @@ func Test_logoutOpts_Run(t *testing.T) {
4142
Confirm: true,
4243
},
4344
}
44-
ctx := t.Context()
45+
ctx := context.TODO()
4546
mockFlow.
4647
EXPECT().
4748
RevokeToken(ctx, gomock.Any(), gomock.Any()).
@@ -71,7 +72,7 @@ func Test_logoutOpts_Run_Keep(t *testing.T) {
7172
},
7273
keepConfig: true,
7374
}
74-
ctx := t.Context()
75+
ctx := context.TODO()
7576
mockFlow.
7677
EXPECT().
7778
RevokeToken(ctx, gomock.Any(), gomock.Any()).

internal/cli/auth/register_test.go

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

1919
import (
2020
"bytes"
21+
"context"
2122
"testing"
2223

2324
"github.com/golang/mock/gomock"
@@ -36,7 +37,7 @@ func Test_registerOpts_Run(t *testing.T) {
3637
mockStore := mocks.NewMockProjectOrgsLister(ctrl)
3738

3839
buf := new(bytes.Buffer)
39-
ctx := t.Context()
40+
ctx := context.TODO()
4041

4142
opts := &RegisterOpts{}
4243
opts.NoBrowser = true

internal/cli/clusters/watch_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
package clusters
1818

1919
import (
20+
"context"
2021
"testing"
2122

2223
"github.com/golang/mock/gomock"
@@ -45,7 +46,7 @@ func TestWatch_Run(t *testing.T) {
4546
Return(expected, nil).
4647
Times(1)
4748

48-
require.NoError(t, opts.Run(t.Context()))
49+
require.NoError(t, opts.Run(context.Background()))
4950
}
5051

5152
func TestWatch_Run_FlexCluster(t *testing.T) {
@@ -66,5 +67,5 @@ func TestWatch_Run_FlexCluster(t *testing.T) {
6667
Return(expected, nil).
6768
Times(1)
6869

69-
require.NoError(t, opts.Run(t.Context()))
70+
require.NoError(t, opts.Run(context.Background()))
7071
}

0 commit comments

Comments
 (0)