Go语言interface(接口)底层实现

Go的interface源码在Golang源码的runtime目录中。 Go在不同版本之间的interface结构可能会有所不同,但是,整体的结构是不会改变的,此文章用的Go版本是1.11。 Go的interface是由两种类型来实现的:iface和eface。 其中,iface表示的是包含方法的interface,例如: type Person interface {     Print() }
相关文章
相关标签/搜索