This repository has been archived on 2021-09-07. You can view files and clone it, but cannot push or open issues or pull requests.
2018-12-01 12:09:22 +08:00

29 lines
304 B
Go

package main
import (
"fmt"
)
// 实现一个Base
type Base struct {
}
func (b *Base) Print() {
fmt.Println("这是base的print")
}
type Example struct {
Base
}
func (e Example) Print() {
fmt.Println("这是example的print")
}
func main() {
e := new(Example)
//e := Example{}
e.Print()
}