4 ms·
I like to call it Quack typing as interfaces are based on behavior and not attributes.
by nemith 7y ago
I like to call it Quack typing as interfaces are based on behavior and not attributes.
- throwaway894345 7y agoStructural subtyping can be based on attributes a la Python’s Protocols.
- IshKebab 7y agoNo they aren't, they're matched based on method names. Go isn't duck typed, except for interfaces which are. Pretty simple.