[go-nuts] Re: My trouble about GO interface

2018-08-10 Thread Henry
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

[go-nuts] Re: My trouble about GO interface

2018-08-09 Thread Tim Peoples
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

[go-nuts] Re: My trouble about GO interface

2018-08-08 Thread Volker Dobler
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