Skip to content

Commit b63092e

Browse files
authored
Merge pull request #3219 from crazy-max/go-1.21
update go to 1.21
2 parents d2b9050 + 34f287e commit b63092e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+291
-223
lines changed

.golangci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
run:
22
tests: false
33
timeout: 10m
4+
45
linters:
56
disable-all: true
67
enable:
@@ -13,3 +14,8 @@ linters:
1314
- unused
1415
- govet
1516

17+
issues:
18+
exclude-files:
19+
- ".*\\.pb\\.go$"
20+
max-issues-per-linter: 0
21+
max-same-issues: 0

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# syntax=docker/dockerfile:1
22

3-
ARG GO_VERSION=1.18.9
3+
ARG GO_VERSION=1.21
44
ARG PROTOC_VERSION=3.11.4
5-
ARG GOLANGCI_LINT_VERSION=v1.50.1
5+
ARG GOLANGCI_LINT_VERSION=v1.57.2
66
ARG DEBIAN_FRONTEND=noninteractive
77

88
FROM --platform=$BUILDPLATFORM golang:${GO_VERSION}-bullseye AS gobase
@@ -126,7 +126,7 @@ ENV GO111MODULE=on
126126
# install the dependencies from `make setup`
127127
# we only copy `direct.mk` to avoid busting the cache too easily
128128
COPY direct.mk .
129-
COPY tools .
129+
COPY tools ./tools
130130
RUN make --file=direct.mk setup
131131
# now we can copy the rest
132132
COPY . .

agent/exec/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ func Do(ctx context.Context, task *api.Task, ctlr Controller) (*api.TaskStatus,
143143
status := task.Status.Copy()
144144

145145
// stay in the current state.
146-
noop := func(errs ...error) (*api.TaskStatus, error) {
146+
noop := func(_ ...error) (*api.TaskStatus, error) {
147147
return status, ErrTaskNoop
148148
}
149149

agent/reporter.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ func newStatusReporter(ctx context.Context, upstream Reporter) *statusReporter {
6868
return r
6969
}
7070

71-
func (sr *statusReporter) UpdateTaskStatus(ctx context.Context, taskID string, status *api.TaskStatus) error {
71+
func (sr *statusReporter) UpdateTaskStatus(_ context.Context, taskID string, status *api.TaskStatus) error {
7272
sr.mu.Lock()
7373
defer sr.mu.Unlock()
7474

@@ -88,7 +88,7 @@ func (sr *statusReporter) UpdateTaskStatus(ctx context.Context, taskID string, s
8888
return nil
8989
}
9090

91-
func (sr *statusReporter) ReportVolumeUnpublished(ctx context.Context, volumeID string) error {
91+
func (sr *statusReporter) ReportVolumeUnpublished(_ context.Context, volumeID string) error {
9292
sr.mu.Lock()
9393
defer sr.mu.Unlock()
9494

agent/storage.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ func WalkTasks(tx *bolt.Tx, fn func(task *api.Task) error) error {
5555
return nil
5656
}
5757

58-
return bkt.ForEach(func(k, v []byte) error {
58+
return bkt.ForEach(func(k, _ []byte) error {
5959
tbkt := bkt.Bucket(k)
6060

6161
p := tbkt.Get(bucketKeyData)
@@ -102,7 +102,7 @@ func WalkTaskStatus(tx *bolt.Tx, fn func(id string, status *api.TaskStatus) erro
102102
return nil
103103
}
104104

105-
return bkt.ForEach(func(k, v []byte) error {
105+
return bkt.ForEach(func(k, _ []byte) error {
106106
tbkt := bkt.Bucket(k)
107107

108108
p := tbkt.Get(bucketKeyStatus)

agent/testutils/fakes.go

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type TestExecutor struct {
2626
}
2727

2828
// Describe just returns empty NodeDescription.
29-
func (e *TestExecutor) Describe(ctx context.Context) (*api.NodeDescription, error) {
29+
func (e *TestExecutor) Describe(_ context.Context) (*api.NodeDescription, error) {
3030
e.mu.Lock()
3131
defer e.mu.Unlock()
3232
if e.desc == nil {
@@ -36,7 +36,7 @@ func (e *TestExecutor) Describe(ctx context.Context) (*api.NodeDescription, erro
3636
}
3737

3838
// Configure does nothing.
39-
func (e *TestExecutor) Configure(ctx context.Context, node *api.Node) error {
39+
func (e *TestExecutor) Configure(_ context.Context, _ *api.Node) error {
4040
return nil
4141
}
4242

@@ -46,7 +46,7 @@ func (e *TestExecutor) SetNetworkBootstrapKeys([]*api.EncryptionKey) error {
4646
}
4747

4848
// Controller returns TestController.
49-
func (e *TestExecutor) Controller(t *api.Task) (exec.Controller, error) {
49+
func (e *TestExecutor) Controller(_ *api.Task) (exec.Controller, error) {
5050
return &TestController{
5151
ch: make(chan struct{}),
5252
}, nil
@@ -66,17 +66,17 @@ type TestController struct {
6666
}
6767

6868
// Update does nothing.
69-
func (t *TestController) Update(ctx context.Context, task *api.Task) error {
69+
func (t *TestController) Update(_ context.Context, _ *api.Task) error {
7070
return nil
7171
}
7272

7373
// Prepare does nothing.
74-
func (t *TestController) Prepare(ctx context.Context) error {
74+
func (t *TestController) Prepare(_ context.Context) error {
7575
return nil
7676
}
7777

7878
// Start does nothing.
79-
func (t *TestController) Start(ctx context.Context) error {
79+
func (t *TestController) Start(_ context.Context) error {
8080
return nil
8181
}
8282

@@ -90,23 +90,23 @@ func (t *TestController) Wait(ctx context.Context) error {
9090
}
9191

9292
// Shutdown closes internal channel
93-
func (t *TestController) Shutdown(ctx context.Context) error {
93+
func (t *TestController) Shutdown(_ context.Context) error {
9494
t.closeOnce.Do(func() {
9595
close(t.ch)
9696
})
9797
return nil
9898
}
9999

100100
// Terminate closes internal channel if it wasn't closed before.
101-
func (t *TestController) Terminate(ctx context.Context) error {
101+
func (t *TestController) Terminate(_ context.Context) error {
102102
t.closeOnce.Do(func() {
103103
close(t.ch)
104104
})
105105
return nil
106106
}
107107

108108
// Remove does nothing.
109-
func (t *TestController) Remove(ctx context.Context) error {
109+
func (t *TestController) Remove(_ context.Context) error {
110110
return nil
111111
}
112112

api/types.pb.go

Lines changed: 70 additions & 35 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)