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

refactor(*): replace experimental maps and slices with stdlib #12141

Merged

Conversation

Juneezee
Copy link
Contributor

Motivation

We upgraded to Go 1.23 in #11363. The experimental functions are now part of the standard library as of Go 1.21 and Go 1.23.

Reference: https://go.dev/doc/go1.21#slices
Reference: https://go.dev/doc/go1.23#iterators

Implementation information

The key difference is that maps.Keys and maps.Values in the golang.org/x/exp package return a slice, whereas maps.Keys and maps.Values in the standard library return an iterator. To work with slices, we need to use slices.Collect to convert the iterator into a slice.

Supporting documentation

@Juneezee Juneezee requested a review from a team as a code owner November 30, 2024 13:19
@Juneezee Juneezee requested review from jijiechen and slonka and removed request for a team November 30, 2024 13:19
@Juneezee Juneezee changed the title refactor: replace experimental maps and slices with stdlib refactor(*): replace experimental maps and slices with stdlib Nov 30, 2024
The experimental functions are now available in the standard library in
Go 1.21 [1] and Go 1.23 [2].

[1]: https://go.dev/doc/go1.21#slices
[2]: https://go.dev/doc/go1.23#iterators

Signed-off-by: Eng Zer Jun <[email protected]>
@Juneezee Juneezee force-pushed the refactor/experimental-maps-slices branch from 26b571b to 5b9ae8f Compare November 30, 2024 13:21
Copy link
Member

@jijiechen jijiechen left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the contribution.

Copy link
Contributor

@bartsmykla bartsmykla left a comment

Choose a reason for hiding this comment

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

lgtm

@bartsmykla bartsmykla merged commit 4fa5da8 into kumahq:master Dec 2, 2024
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants