On Mon, Sep 9, 2024 at 9:24 PM P Padil <
ppad...@gmail.com> 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.