DEV Community

Discussion on: The Problem with Interfaces, and how Go Fixed it

Collapse
 
danielhoffmann_ profile image
Daniel HB

Interesting, so there is some type inference going on when you throw an object at a method that expects an Interface as an argument. Thanks for the explanation!

Thread Thread
 
kunde21 profile image
Chad Kunde

In the case of passing a struct into a function that takes an interface, the compiler enforces interface requirements. It will even tell you what methods are missing from the type which cause it not to fulfill the interface.