Skip to content

x/exp/slices: "backport" slices.SortFunc #61374

@ghost

Description

slices.SortFunc is coming soon:

https://pkg.go.dev/slices#SortFunc

but its not here yet. meanwhile, the signature:

func SortFunc[S ~[]E, E any](x S, cmp func(a, b E) int)

is different from x/exp/slices:

func SortFunc[E any](x []E, less func(a, b E) bool)

https://pkg.go.dev/golang.org/x/exp/slices#SortFunc

namely, the callback returns int instead of bool.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsFixThe path to resolution is known, but the work has not been done.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions