For example in the following example:
type Food interface {
Eat() bool
}
type vegetable_s struct {
//some data
}
type Vegetable *vegetable_s
type Salt struct {
// some data
}
func (p Vegetable) Eat() bool {
// some code
}
func (p Salt) Eat() bool {
// some code
}
Do Vegetable
and Salt
both satisfy Food
, even though one is a pointer and the other is directly a struct?