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 #6372

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

Conversation

Juneezee
Copy link
Contributor

@Juneezee Juneezee commented Nov 28, 2024

The experimental functions are now part of the standard library as of Go 1.21 and Go 1.23.

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.

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

Checklist

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 <engzerjun@gmail.com>
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
@Juneezee Juneezee requested a review from a team as a code owner November 28, 2024 10:26
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
@wozniakjan
Copy link
Member

wozniakjan commented Dec 2, 2024

/run-e2e internal|opentelemetry_metrics
Update: You can check the progress here

Copy link
Member

@wozniakjan wozniakjan left a comment

Choose a reason for hiding this comment

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

lgtm, thank you!

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.

2 participants