Re:Why I like Golang's interfaces
by eximius on Thursday April 13, 2017 @10:44AM
(#14107359)
Have any go developers run into issues where an interface is satisfied where it shouldn't be due to name conflicts?
[ Parent
| on HN ]
Technically it happens occasionally, especially if you prefer terse method names and/or small interface definitions. However I have yet to see an example of it causing an issue. Usually I see problems where a struct doesn't satisfy an interface where it "should".
I've been developing Go apps for 4 years now. So far this has never happened to me. I do agree it's a possibility, if a callee was to do a type assertion or something.
Not really. Can you describe a situation where accidentally satisfying an unrelated interface would cause a problem?
The worst I can think of are possible developer confusion, and maybe your autocomplete suggesting the wrong thing.
what do you mean?
I think they mean accidentally satisfied interfaces.