Migrate golang.org/x/exp/slices to slices
ProprietaryRepoint 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. MigrateXExpSlicesToStdlibmod run . --recipe= org. openrewrite. golang. migration. MigrateXExpSlicesToStdlibInstall it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.