The answer is easy to get from compile code :
prog.go:19: invalid receiver type Vegetable (Vegetable is a pointer type)
The error is based on specifications :
The receiver type must be of the form T or * T, where T is the type name. The type denoted by T is called the base type of the receiver; it must not be a pointer or interface type , and it must be declared in the same package as the method.
(Emphasizes mine)
Ad:
type Vegetable *vegetable_s
declares a pointer type, i.e. Vegetable not suitable as a method receiver.
source share