Closed sdboyer closed 10 years ago
basically...either the struct has to be exposed, or a unique interface has to be composed for each one. kinda six one half dozen the other.
pinging @technosophos and @mattfarina for their input on this
ok, it's pretty clear that the best solution here is to export the structs. the only real argument against that is 'noise' in the godoc; all the other arguments are in favor of it.
I was thinking the same thing. I gave it a day and still came to the same conclusion.
excellent - now it's just a SMOP before declaring VICTORY
the way gogl is written right now, each graph implements a handful of interfaces. keeping track of this in client code is kinda crazy, and just about destroys the idea behind interfaces: to abstract implementation details away. when there are no unified interfaces, it effectively means that client code has to know which graph they're working with, and which interfaces they can switch it to. bleh.
the idiomatic Go answer is to export the struct, and have that be the primary thing that's passed around, except in cases where it a single, more specific interface is genuinely all that's needed. that may be the way to go (though it kinda runs counter to #1), and would definitely result in a giant explosion of godoc.