by Joker_vD · 1y ago · 0 comments
First, why would you ever add methods to a public interface? Second, the next version of the Backup's implementation might very well want to call Load as well (e.g. for deduplication purposes) and then you suddenly need to add more methods to your fakes anyhow.
In the end, it really depends on who owns FileStorage and Backup: if it's the same team/person, the ISP is immaterial. If they are different, then yes, the owner of Backup() would be better served by declaring a Storage interface of their own and delegate the job of writing adapters that make e.g. FileStorage to conform to it to the users of Backup() method.
In the go world, it's a little more acceptable to do that versus something like Java because you're really not going to break anything
For a public interface, you have to track down all the clients, which may be infeasible, especially in an open ecosystem.