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.
readis a method on an interface thatFileimplements - it is not inherited from a base class. You can use thatFiledirectly, or wherever aReaderinterface (or whatever the name is, idk I don’t really do Go) is expected.