3 ms·
Not sure what this has to do with generics, Go requires types for function arguments. If your anonymous function gets clumsy and too big in place, just use a na
by grey-area 9y ago
Not sure what this has to do with generics, Go requires types for function arguments. If your anonymous function gets clumsy and too big in place, just use a named function not an anonymous one:
print("hello", myprinter)
https://play.golang.org/p/3sNOeVIhqi https://play.golang.org/p/3sNOeVIhqi
- keymone 9y agopoint is typedefs aren't reusable at anonymous function declarations. imo that sucks. that's all i wanted to say.
- davidarkemp2 9y agoYou could always declare the method on the Printer type... https://play.golang.org/p/4MG8kgGEGM https://play.golang.org/p/4MG8kgGEGM
- keymone 9y agowhere's the anonymous function with reuse of typedef in there?