4 ms·
Have any go developers run into issues where an interface is satisfied where it shouldn't be due to name conflicts?
by eximius 10y ago
Have any go developers run into issues where an interface is satisfied where it shouldn't be due to name conflicts?
- ryancouto 10y agowhat do you mean?
- deleted 10y ago[deleted]
- zellyn 10y agoNot 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.
- gjem97 10y agoTechnically 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".
- echlebek 10y agoI'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.