2 ms·
> If you're casting, then it's not real duck typing. 'If' being the operative word. You're not actually casting. That was merely to not try and confuse the com
by randomdata 2y ago
> If you're casting, then it's not real duck typing.
'If' being the operative word. You're not actually casting. That was merely to not try and confuse the commenter further. In fact, Go doesn't even support casting! It does support type conversion, which is oft confused with casting, but that uses the syntax `type(variable)`, which is not what is going on here either.
> In reality there is no interface tying the methods together, and the whole thing is done at runtime, along with a runtime error if the method doesn't exist.
Right, which is how it works.