
In the Go programming language, you do not say explicitly that your type implements a given interface. Instead, a type is convertible to any interface, just so long as it implements all the methods in the interface. This often reminds people of "duck typing" in dynamic languages such as Python or Ruby, but it is faster; in fact, Go interface calls are the same speed as virtual method calls in C++ and C#!
|