摘要: time标准库 时间类型 time.Time now := time.Now() fmt.Println(now) fmt.Println(now.Year()) fmt.Println(now.Month()) fmt.Println(now.Day()) fmt.Println(now.Date 阅读全文
posted @ 2021-09-16 10:49 lcsp 阅读(58) 评论(0) 推荐(0) 编辑
摘要: 接口 接口是一种类型,是一种特殊的类型,它规定了变量有哪些方法 接口的定义 type 接口名 interface { 方法名1(参数1,参数2),(返回值1,返回值2...) 方法名2(参数1,参数2),(返回值1,返回值2...) } 用来给变量、参数、返回值等设置类型 接口的实现 一个变量如果实 阅读全文
posted @ 2021-09-16 09:55 lcsp 阅读(134) 评论(0) 推荐(0) 编辑