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 exp/slices with slices from standard library #626

Merged
merged 2 commits into from
Dec 16, 2024

Conversation

Juneezee
Copy link
Contributor

What this PR does:

"golang.org/x/exp/slices" // using exp/slices until moving to go 1.21.

We upgraded the minimum Go version to 1.21 in PR #540.

The experimental functions in golang.org/x/exp/slices are now included in the standard library since Go 1.21.

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

Which issue(s) this PR fixes:

Checklist

  • [N/A] Tests updated
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

The experimental functions in `golang.org/x/exp/slices` are now
available in the standard library in Go 1.21 [1].

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

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
@CLAassistant
Copy link

CLAassistant commented Dec 16, 2024

CLA assistant check
All committers have signed the CLA.

func New[E constraints.Ordered](lists [][]E, maxVal E) *Tree[E] {
func New[E cmp.Ordered](lists [][]E, maxVal E) *Tree[E] {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The constraints.Ordered from golang.org/x/exp/constraints is also included into Go 1.21 as cmp.Ordered. See https://pkg.go.dev/cmp#Ordered

Copy link
Collaborator

@aknuds1 aknuds1 left a comment

Choose a reason for hiding this comment

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

LGTM except there shouldn't be a changelog item.

CHANGELOG.md Outdated Show resolved Hide resolved
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
@Juneezee Juneezee requested a review from aknuds1 December 16, 2024 17:05
Copy link
Collaborator

@aknuds1 aknuds1 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!

@aknuds1 aknuds1 enabled auto-merge (squash) December 16, 2024 17:13
@aknuds1 aknuds1 merged commit 0450f2b into grafana:main Dec 16, 2024
5 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