0

Interface

 2 years ago
source link: https://linuxsuren.github.io/blog/language/golang/interface/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Interface

Interface
type InterfaceTypeName interface {
    Print()
}

实现方法的区别

type Demo struct{}

func (i InterfaceTypeName) Print(){}

type Demo2 struct {}

func (i *InterfaceTypeName) Print(){}

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK