I've been following the same Github issue.

> ... but the particularly annoying part is having to clutter the global
> namespace by adding a global type which implements the interface
>

As part of an extension to sortGen
<https://github.com/myitcv/sorter/tree/master/cmd/sortGen> I've also been
thinking about this question, for both types and functions.

But I've been trying to answer it in the context of ensuring that compile-time
optimisation is still possible
<https://github.com/golang/go/issues/16721#issuecomment-240970016>.

My current thinking is that I will create an internal package
<https://docs.google.com/document/d/1e8kOo3r51b2BWtTs_1uADIA5djfXhPT36s6eHVRIvaU/edit>
(as
part of my code generation) to contain the function/type.

I think this approach will also work in your situation. Thoughts?

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to