I re-read your question and realized that no one really answered it. I didn't want to get into the whole concept of packages in Go in the blog post so I didn't go into it. Basically, when referring to a type, variable, or anything, you refer to it through packagename.whatever. Our Edible interface could be referred to as mypackage.Edible, the Burger struct could be referred to as mypackage.Burger, although we can just refer to them as Edible and Burger because they are in our package.
Meanwhile, the Salad struct must be referred to as theirpackage.Salad because it is in a different package.
Also, in terms of type collisions with method names, all arguments and the return type must match the interface's in order for it to be considered "implemented".
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I re-read your question and realized that no one really answered it. I didn't want to get into the whole concept of packages in Go in the blog post so I didn't go into it. Basically, when referring to a type, variable, or anything, you refer to it through
packagename.whatever
. OurEdible
interface could be referred to asmypackage.Edible
, theBurger
struct could be referred to asmypackage.Burger
, although we can just refer to them asEdible
andBurger
because they are in our package.Meanwhile, the
Salad
struct must be referred to astheirpackage.Salad
because it is in a different package.Also, in terms of type collisions with method names, all arguments and the return type must match the interface's in order for it to be considered "implemented".