關於go語言的interface(接口)的理解小記 2020.11.2

main.go: package main import "fmt" type Book interface {//定義一個接口,裏面有兩個方法 fanshu() 和 bishu() fanshu() bishu() } type Book01 struct {//定義一個Book01類型的接口體,裏面有一個Name屬性(字段) Name string } func (b
相關文章
相關標籤/搜索