tag:blogger.com,1999:blog-4273255328290947077.post398592651656858728..comments2023-05-17T10:04:02.732-06:00Comments on Being Cellfish: Go for C# developers: Where to define interfacescellfishhttp://www.blogger.com/profile/12888771675677858223noreply@blogger.comBlogger2125tag:blogger.com,1999:blog-4273255328290947077.post-35623711198270243632016-09-17T00:12:45.161-06:002016-09-17T00:12:45.161-06:00So there is an interface. Another way of describin...So there is an interface. Another way of describing it is that in Go the interface is a contract on how you want to consume something rather than a contract of how something is produced. In other words declare what you want rather than what you are.<br /><br />From a refactoring perspective I don't see a difference as if you change the interface but not the concrete type (or vice versa) the code will no longer compile as the concrete implementation can no longer be used where the interface is expected.<br /><br />But yes this also means that if you have two types (A and B) that both "implement" the Foo interface but in practice only A is used as a Foo, then the compiler does not care that you don't have to change B as it is never used as a Foo.cellfishhttps://www.blogger.com/profile/12888771675677858223noreply@blogger.comtag:blogger.com,1999:blog-4273255328290947077.post-84288705085941805272016-09-16T14:41:11.585-06:002016-09-16T14:41:11.585-06:00Just curious: how do you perform refactoring actio...Just curious: how do you perform refactoring actions such as method renaming when there is no contract (such as an interface)?<br />Pascal Craponnehttps://www.blogger.com/profile/12489112414523405013noreply@blogger.com