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

*: replace golang.org/x/exp with standard library #8021

Merged
merged 2 commits into from
Dec 24, 2024

Conversation

Juneezee
Copy link
Contributor

  • I added CHANGELOG entry for this change.
  • Change is not relevant to the end user.

Changes

These experimental packages are now available in the Go standard library. Since we upgraded our minimum Go version to 1.23 in PR #7796, we can replace them with the standard library:

  1. golang.org/x/exp/slices -> slices (https://go.dev/doc/go1.21#slices)
  2. golang.org/x/exp/maps -> maps (https://go.dev/doc/go1.21#maps)
  3. golang.org/x/exp/rand -> math/rand/v2 (https://go.dev/doc/go1.22#math_rand_v2)

Verification

These experimental packages are now available in the Go standard
library. Since we upgraded our minimum Go version to 1.23 in PR
#7796, we can replace them with
the standard library:

	1. golang.org/x/exp/slices -> slices [1]
	2. golang.org/x/exp/maps -> maps [2]
	3. golang.org/x/exp/rand -> math/rand/v2 [3]

[1]: https://go.dev/doc/go1.21#slices
[2]: https://go.dev/doc/go1.21#maps
[3]: https://go.dev/doc/go1.22#math_rand_v2

Signed-off-by: Eng Zer Jun <[email protected]>
Two sections in total: one for direct dependencies, and one for indirect
dependencies.

Reference: golang/go#56471
Signed-off-by: Eng Zer Jun <[email protected]>
Copy link
Contributor Author

@Juneezee Juneezee left a comment

Choose a reason for hiding this comment

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

This PR also properly tidies up the go.mod file. There is a known issue where go mod tidy does not join multiple require sections into just two sections (direct and indirect), as described here: golang/go#56471.

Copy link
Contributor

@pedro-stanaka pedro-stanaka left a comment

Choose a reason for hiding this comment

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

lg

@fpetkovski fpetkovski merged commit ab13e10 into thanos-io:main Dec 24, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants