Interface
定义
type InterfaceTypeName interface {
Print()
}
实现方法的区别
type Demo struct{}
func (i InterfaceTypeName) Print(){}
type Demo2 struct {}
func (i *InterfaceTypeName) Print(){}
type InterfaceTypeName interface {
Print()
}
type Demo struct{}
func (i InterfaceTypeName) Print(){}
type Demo2 struct {}
func (i *InterfaceTypeName) Print(){}