Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from
Nov 15, 2024

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>
@thaJeztah thaJeztah added status/2-code-review kind/bugfix PR's that fix bugs area/go-sdk Changes affecting the Go SDK labels Nov 15, 2024
@thaJeztah thaJeztah added this to the 27.4.0 milestone Nov 15, 2024
@thaJeztah thaJeztah self-assigned this Nov 15, 2024
@codecov-commenter
Copy link

codecov-commenter commented Nov 15, 2024

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.x Nov 15, 2024
102 checks passed
@thaJeztah thaJeztah deleted the 27.x_backport_update_buildtags branch November 15, 2024 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/go-sdk Changes affecting the Go SDK kind/bugfix PR's that fix bugs status/2-code-review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants