When designing a Go program, remember that there is no type hierarchy in Go.
You create the actual Elephant, Tiger, etc., but not Animal since Animal is
just a classification.
In my fictional world, I may have Alice, Bob, and Charlie. If I need a banker,
I just put up an ads with the job speci
I think the confusion comes from how you're exposing each interface -- or
rather, how you seem to imply their use.
In your example, you provide packages pet and filepath each of which define
a Walk interface *plus* one or more structs that implement that interface.
But, neither package consumes
Who would walk his dog on a file path?
Seriously.
There os no need to technically forbid something
nobody will do. Someone who is not willing to read
or incapable of understand your documentation of
the interface won't be able to use it properly anyway.
Go is not done through "Ctrl+Space driven