Migrate golang.org/x/exp/slices to slices

Proprietary

Repoint golang.org/x/exp/slices at the standard library slices, added in Go 1.21. Every x/exp function exists there under the same name and signature, so call sites are unchanged. A file is skipped when the module targets an older Go release, when it already imports slices, or when it passes a boolean comparator to SortFunc, SortStableFunc, IsSortedFunc, MinFunc or MaxFunc — the pre-2023 x/exp signature, which needs a hand conversion to a three-way cmp function.

org.openrewrite.golang.migration.MigrateXExpSlicesToStdlib
mod run . --recipe=org.openrewrite.golang.migration.MigrateXExpSlicesToStdlib

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.