标签:多态

Golang 接口与多态

Jackey Golang 336 次浏览 , ,
package main import ( "fmt" ) type A interface { Get() } type B struct { } func (b *B) Get () { fmt.Println("b") } type C struct { } func (c *C) Get () { fmt.Println("c") } f...
Go