例如在以下示例中:
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
}
是否Vegetable
都Salt
满足Food
,即使一个是指针而另一个直接是结构?