-
Notifications
You must be signed in to change notification settings - Fork 811
Modernize #6118
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
Modernize #6118
Conversation
Brought to you by gofmt -r 'interface{} -> any' -w . Signed-off-by: Kir Kolyshkin <[email protected]>
A slice returned by os.Environ is a already a brand new copy, no need to copy it again. Signed-off-by: Kir Kolyshkin <[email protected]>
Available since Go 1.22 (see https://tip.golang.org/ref/spec#For_range). Signed-off-by: Kir Kolyshkin <[email protected]>
Ephemeral COPR build failed. @containers/packit-build please check. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, except for a second "import" being added to a source file.
Signed-off-by: Kir Kolyshkin <[email protected]>
Signed-off-by: Kir Kolyshkin <[email protected]>
Signed-off-by: Kir Kolyshkin <[email protected]>
Signed-off-by: Kir Kolyshkin <[email protected]>
No functionality change, just code simplification. Covered by existing test (e.g. "run should also override /etc/hostname" in tests/run.bats). NO NEW TESTS NEEDED Signed-off-by: Kir Kolyshkin <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kolyshkin, Luap99, nalind The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Converts the code to use various Go 1.23+ features:
any
instead ofinterface{}
(available since Go 1.18);for range
over integers (available since Go 1.22, https://tip.golang.org/ref/spec#For_range)slices
andmaps
methods more, where appropriate (Go 1.21...1.23)Please see individual commit for details.
Mostly found by modernize.
How to verify it
Existing tests should be adequate.
Which issue(s) this PR fixes:
None
Special notes for your reviewer:
Does this PR introduce a user-facing change?