On Mon, Sep 9, 2024 at 9:24 PM P Padil <[email protected]> wrote:
> Can someone please explain to me why the following doesn’t work:
>
> slices.SortFunc(ilps, func(u, w *big.Int) int { return u.Cmp(w) })
>
> I get:
> slices.SortFunc(ilps, (func(u, w *big.Int) int literal)) (no value) used as
> value
Providing a complete, self-contained, runnable code help others to help you.
Without that I can only guess: you have used the non-value, as
indicated by the error message, as a RHS in an assignment. But its
signature shows it does not return any value:
https://pkg.go.dev/slices#SortFunc
tl;dr: SortFunc sorts the underlying array of the argument slice but
it does not return the slice.
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/golang-nuts/CAA40n-UQfpTW_g8L3AFz3tu3whrQmGUWA44Q42adMsxb8y5Q2A%40mail.gmail.com.