Using interface casting, Golang do support "duck typing" in similar fashion as ruby's Object class.
Here, by convention, the instance of Dog doesn't support "type" Happy(), therefore fails at runtime.
So golang is somewhat dynamic as well, although using interface{} is kludgy and one would want to avoid that and reflection whenever possible.
https://play.golang.org/p/d0TkGTCZa2S
Runtime results in panic:
Using interface casting, Golang do support "duck typing" in similar fashion as ruby's Object class. Here, by convention, the instance of Dog doesn't support "type" Happy(), therefore fails at runtime.So golang is somewhat dynamic as well, although using interface{} is kludgy and one would want to avoid that and reflection whenever possible.