Thank you very much Axel for this crystal clear explanation.
Best regards
Le mer. 11 mai 2022 à 17:56, Axel Wagner a
écrit :
> When you write [S []any], this means "S must have type []any". `[]int` has
> type `[]int`, which is different from `[]any`, so this doesn't work - and
> it can't work:
When you write [S []any], this means "S must have type []any". `[]int` has
type `[]int`, which is different from `[]any`, so this doesn't work - and
it can't work:
https://blog.merovius.de/posts/2018-06-03-why-doesnt-go-have-variance-in/
When you write [E any, S []E], you say "E must be any type a
Hi gophers!
This code https://go.dev/play/p/QHIxegJn3aj doesn't compile. I don't
understand why. Anyone would have an explanation? And why this
code https://go.dev/play/p/PCSzRkLvXhp fixes it?
Thanks for your replies
Best regards
--
Michel Casabianca
--
You received this message because you a