Re: [go-nuts] stucked in the interface mud

2017-11-21 Thread 'Axel Wagner' via golang-nuts
This question is frequently asked . In short: Because the arguments to myType.Less have to be of type Compare, not myType. Go does not have polymorphic types. To answer the "how should this be done in Go the right way": IMO the answer is "not".

Re: [go-nuts] stucked in the interface mud

2017-11-21 Thread Jan Mercl
On Tue, Nov 21, 2017 at 2:40 PM wrote: https://play.golang.org/p/InPAO_haLU works, but I don't think it's what you're after, because once more types implement Compare this approach gets dirty with type too many type switches. -- -j -- You received this message

[go-nuts] stucked in the interface mud

2017-11-21 Thread christian . b . mueller
hi there, and first of all sorry that i couldn't find the answer by myself here. I tried to improve some of my code with general interface definitions. They should work like macros for different types of variables. Here is my reduced example and the question - how should this be done in go the