Y
Hacker News
new
|
ask
|
show
|
jobs
by
stonemetal
3929 days ago
Not really, Go uses duck typing for interfaces. You declare an interface to require functions X, Y, and Z. Any type that has functions X, Y, and Z suddenly implements that interface whether you want it to or not.
1 comments
joshuacc
3920 days ago
As I understand it, the correct term for that is "structural typing." Duck typing is similar, but applies exclusively to dynamic languages. See:
https://en.wikipedia.org/wiki/Duck_typing#Structural_type_sy...
link