Skip to content

[27.x backport] update go:build tags to use go1.22, fix missing go:build tag - #5622

Merged
thaJeztah merged 2 commits into
docker:27.xfrom
thaJeztah:27.x_backport_update_buildtags
Nov 15, 2024
Merged

[27.x backport] update go:build tags to use go1.22, fix missing go:build tag#5622
thaJeztah merged 2 commits into
docker:27.xfrom
thaJeztah:27.x_backport_update_buildtags

Conversation

commit 4a7b04d configured golangci-lint
to use go1.23 semantics, which enabled the copyloopvar linter.
go1.22 now creates a copy of variables when assigned in a loop; make sure we
don't have files that may downgrade semantics to go1.21 in case that also means
disabling that feature; https://go.dev/ref/spec#Go_1.22
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 7c80e4f)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
 make shell
make -C ./internal/gocompat/
GO111MODULE=on go test -v
# github.com/docker/cli/cli/command/container
../../cli/command/container/completion.go:37:28: implicit function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
../../cli/command/container/completion.go:82:25: implicit function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
../../cli/command/container/completion.go:92:27: implicit function instantiation requires go1.18 or later (-lang was set to go1.16; check go.mod)
FAIL	gocompat [build failed]
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit d1d5353)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztahthaJeztah added status/2-code-review kind/bugfix PR's that fix bugs area/go-sdk Changes affecting the Go SDK labels Nov 15, 2024
@thaJeztahthaJeztah added this to the 27.4.0 milestone Nov 15, 2024
@thaJeztahthaJeztah self-assigned this Nov 15, 2024
@thaJeztah
thaJeztah requested review from a team and silvin-lubecki as code ownersNovember 15, 2024 10:12
@codecov-commenter

codecov-commenter commented Nov 15, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 58.55%. Comparing base (a4dc3d7) to head (cfe6090).
Report is 4 commits behind head on 27.x.

Additional details and impacted files
@@ Coverage Diff @@## 27.x #5622 +/- ##
=======================================
Coverage 58.55% 58.55% =======================================
Files 346 346 Lines 29329 29329 =======================================
Hits 17173 17173 Misses 11178 11178 Partials 978 978 

@thaJeztah
thaJeztah merged commit 8d1baca into docker:27.xNov 15, 2024
@thaJeztah
thaJeztah deleted the 27.x_backport_update_buildtags branch November 15, 2024 10:25
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/go-sdkChanges affecting the Go SDKkind/bugfixPR's that fix bugsstatus/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@thaJeztah@codecov-commenter@vvoland@Benehiko