Skip to content

Conversation

Juneezee
Copy link
Contributor

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

However, we cannot remove the golang.org/x/exp dependency yet because we still rely on the golang.org/x/exp/constraints package, which has not yet been included into the standard library (golang/go#61914).

An alternative approach is to create our own implementation, e.g. constraints.go like this PR hashicorp/terraform-plugin-testing#260 so we can remove the golang.org/x/exp dependency completely.

"golang.org/x/exp/constraints"

"golang.org/x/exp/constraints"

Footnotes

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

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>
@wader
Copy link
Owner

wader commented Dec 12, 2024

Thanks 👍 yeah maybe would be nice to remove golang.org/x/exp dependency completely then. Feel free to amend that to this PR or create a new PR for it.

Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
@Juneezee Juneezee changed the title Replace exp/slices package with standard library Remove golang.org/x/exp dependency Dec 12, 2024
@Juneezee
Copy link
Contributor Author

Thanks 👍 yeah maybe would be nice to remove golang.org/x/exp dependency completely then. Feel free to amend that to this PR or create a new PR for it.

Done! Please take a look again. Thanks 😊

@wader wader merged commit 64ac67f into wader:master Dec 12, 2024
5 checks passed
@wader
Copy link
Owner

wader commented Dec 12, 2024

Thanks!

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