Hacker News new | ask | show | jobs
by grey-area 3281 days 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
1 comments

point is typedefs aren't reusable at anonymous function declarations. imo that sucks. that's all i wanted to say.
You could always declare the method on the Printer type...

https://play.golang.org/p/4MG8kgGEGM

where's the anonymous function with reuse of typedef in there?