|
|
|
|
|
by tsimionescu
2460 days ago
|
|
The problem of finding implementations of an interface is harder if they live in separate packages, isn't it? Why would it be a non-issue? I'm not saying that we should define them together, the article makes sense in its recommendation. I'm just saying that the GP also seems correct to me, there is a problem in finding interface implementations in Go that would be lessened by explicit implementation (though I hope go pls will fix this on the tooling side). |
|
As OP says usually the consumer defines an interface, so they aren’t ‘used’ in lots of places, and are rarely changed independent of the code that uses them (which could easily use its own interface instead if required). Typically the implementer changes (which doesn’t matter as long as it still conforms), not the interface.
The exception would be interfaces provided in the std lib, like io.Reader, which are widely used elsewhere but those won’t change at this point.