You’re confusing polymorphism for inheritance. read is a method on an interface that File implements - it is not inherited from a base class. You can use that File directly, or wherever a Reader interface (or whatever the name is, idk I don’t really do Go) is expected.
You’re confusing polymorphism for inheritance.
read
is a method on an interface thatFile
implements - it is not inherited from a base class. You can use thatFile
directly, or wherever aReader
interface (or whatever the name is, idk I don’t really do Go) is expected.