Skip to content

Commit 691e9aa

Browse files
committed
Upgrade the golangci-lint dependency.
* The older version of `golangci-lint` on version `v1.52.1` was consuming an inordinate amount of memory, and thus ended up getting killed by the OS mid run. See golangci/golangci-lint#3582. * Upgrade to a newer version of `golangci-lint`, `v1.61.0`. * Fix all lint errors reported with the newer version.
1 parent 39b5074 commit 691e9aa

File tree

6 files changed

+11
-14
lines changed

6 files changed

+11
-14
lines changed

go.mod

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

3-
go 1.23.1
3+
go 1.23
44

55
// These are test-only dependencies
66
require github.com/onsi/gomega v1.27.5

hack/tools.mk

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,11 @@ GOLANGCI_LINT := $(TOOLS_BIN_DIR)/golangci-lint
88
GO_ADD_LICENSE := $(TOOLS_BIN_DIR)/addlicense
99

1010
# default tool versions
11-
GOLANGCI_LINT_VERSION ?= v1.51.2
11+
GOLANGCI_LINT_VERSION ?= v1.61.0
1212
GO_ADD_LICENSE_VERSION ?= latest
1313

1414
export TOOLS_BIN_DIR := $(TOOLS_BIN_DIR)
1515
export PATH := $(abspath $(TOOLS_BIN_DIR)):$(PATH)
16-
$(info "TOOLS_BIN_DIR from tools.mk", $(TOOLS_BIN_DIR))
17-
$(info "TOOLS_DIR from tools.mk", $(TOOLS_DIR))
18-
$(info "PATH from tools.mk", $(PATH))
1916

2017
#########################################
2118
# Tools #

internal/app/fakes.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,31 +14,31 @@ import (
1414
type EtcdFakeKV struct{}
1515

1616
// Get gets a value for a given key.
17-
func (c *EtcdFakeKV) Get(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.GetResponse, error) {
17+
func (c *EtcdFakeKV) Get(_ context.Context, _ string, _ ...clientv3.OpOption) (*clientv3.GetResponse, error) {
1818
return nil, nil
1919
}
2020

2121
// Put puts a value for a given key.
22-
func (c *EtcdFakeKV) Put(ctx context.Context, key, val string, opts ...clientv3.OpOption) (*clientv3.PutResponse, error) {
22+
func (c *EtcdFakeKV) Put(_ context.Context, _, _ string, _ ...clientv3.OpOption) (*clientv3.PutResponse, error) {
2323
return nil, nil
2424
}
2525

2626
// Delete deletes an entry with a given key.
27-
func (c *EtcdFakeKV) Delete(ctx context.Context, key string, opts ...clientv3.OpOption) (*clientv3.DeleteResponse, error) {
27+
func (c *EtcdFakeKV) Delete(_ context.Context, _ string, _ ...clientv3.OpOption) (*clientv3.DeleteResponse, error) {
2828
return nil, nil
2929
}
3030

3131
// Compact compacts etcd KV history before the given rev.
32-
func (c *EtcdFakeKV) Compact(ctx context.Context, rev int64, opts ...clientv3.CompactOption) (*clientv3.CompactResponse, error) {
32+
func (c *EtcdFakeKV) Compact(_ context.Context, _ int64, _ ...clientv3.CompactOption) (*clientv3.CompactResponse, error) {
3333
return nil, nil
3434
}
3535

3636
// Txn creates a transaction.
37-
func (c *EtcdFakeKV) Txn(ctx context.Context) clientv3.Txn {
37+
func (c *EtcdFakeKV) Txn(_ context.Context) clientv3.Txn {
3838
return nil
3939
}
4040

4141
// Do applies a single Op on KV without a transaction.
42-
func (c *EtcdFakeKV) Do(ctx context.Context, op clientv3.Op) (clientv3.OpResponse, error) {
42+
func (c *EtcdFakeKV) Do(_ context.Context, _ clientv3.Op) (clientv3.OpResponse, error) {
4343
return clientv3.OpResponse{}, nil
4444
}

internal/bootstrap/bootstrap_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ func deleteTestDir(t *testing.T, testDir string) {
227227

228228
func getTestHttpClient(responseCode int, responseBody []byte) *http.Client {
229229
return &http.Client{
230-
Transport: TestRoundTripper(func(req *http.Request) *http.Response {
230+
Transport: TestRoundTripper(func(_ *http.Request) *http.Response {
231231
var contentLen int64
232232
if responseBody != nil {
233233
contentLen = int64(len(responseBody))

internal/brclient/brclient_test.go

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

205205
func getTestHttpClient(responseCode int, responseBody []byte) *http.Client {
206206
return &http.Client{
207-
Transport: TestRoundTripper(func(req *http.Request) *http.Response {
207+
Transport: TestRoundTripper(func(_ *http.Request) *http.Response {
208208
var contentLen int64
209209
if responseBody != nil {
210210
contentLen = int64(len(responseBody))

internal/util/retry_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func TestErrorIfExceedsAttempts(t *testing.T) {
4444
for _, entry := range table {
4545
g := NewWithT(t)
4646
logger := zaptest.NewLogger(t)
47-
t.Run(entry.description, func(t *testing.T) {
47+
t.Run(entry.description, func(_ *testing.T) {
4848
defer clearRetryResults()
4949
result := Retry(context.Background(), logger, operation, neverSucceeds, numAttempts, backOff, entry.canRetryFn)
5050
g.Expect(result.Value).To(Equal(attemptFailed))

0 commit comments

Comments
 (0)