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

Switch to Go 1.23+ stdlib maps/slices packages #3080

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tklauser
Copy link
Member

@tklauser tklauser commented Nov 7, 2024

Use the maps and slices packages from the Go standard library instead of the respective golang.org/x/exp packages.

Also add a linter check enforcing use of these packages.

Use the maps and slices packages from the Go standard library instead of
the respective golang.org/x/exp packages.

Signed-off-by: Tobias Klauser <tobias@cilium.io>
…nymore

Use the gomodguard linter to check that the
golang.org/x/exp/{maps,slices} packages are no longer used and their
stdlib library equivalents are preferred instead.

Signed-off-by: Tobias Klauser <tobias@cilium.io>
@tklauser tklauser requested a review from a team as a code owner November 7, 2024 10:00
@tklauser tklauser requested a review from tixxdz November 7, 2024 10:00
@tklauser tklauser added the release-note/misc This PR makes changes that have no direct user impact. label Nov 7, 2024
Copy link
Member

@mtardy mtardy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Especially for the linter check, very nice! I need to read about this new iterator feature, I didn't know.

@tklauser
Copy link
Member Author

tklauser commented Nov 7, 2024

Thanks! Especially for the linter check, very nice! I need to read about this new iterator feature, I didn't know.

In case you didn't see it yet, https://go.dev/blog/range-functions is a nice introduction to the new iterators (also called range-over-func) in Go 1.23.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/misc This PR makes changes that have no direct user impact.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants