3 ms·
In golang, you can reasonably have a collection of things accessed through interfaces, check whether each one conforms to additional interfaces, and call the me
by anonymoushn 5y ago
In golang, you can reasonably have a collection of things accessed through interfaces, check whether each one conforms to additional interfaces, and call the methods of those additional interfaces if so. If user code does this, then adding a new method to a library can cause user code to break.
You may say "Well, don't do that," but it seems like golang users think of this as a way to provide backwards-compatible API upgrades[0].
[0]: https://avtok.com/2014/11/05/interface-upgrades.html https://avtok.com/2014/11/05/interface-upgrades.html