you are viewing a single comment's thread
view the rest of the comments
[–] 8 points 3 years ago

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.

  • source
  • parent