摘要:
一、接口 type Car interface { //定义一个Car的接口 what() //定义一个方法 } type Bicycle struct { } type Motor struct { } func (bicycle Bicycle) what() { fmt.Println("I 阅读全文
posted @ 2020-12-02 18:52
Auler
阅读(129)
评论(0)
推荐(0)
摘要:
一、切片Slice func main() { fmt.Println("Hello, World!") s := []int{1, 2, 3} //数组 printSlice(s) fmt.Println(s[0:2]) //使用切片方式 fmt.Println(s[:2]) fmt.Printl 阅读全文
posted @ 2020-12-02 13:27
Auler
阅读(103)
评论(0)
推荐(0)

浙公网安备 33010602011771号