上一页 1 2 3 4 5 6 7 8 ··· 11 下一页
摘要: 缓冲式写入文件 便携式写入文件 判断文件是否存在 阅读全文
posted @ 2019-11-30 17:05 Ethan_Cheng 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 打开文件 缓冲式读文件 使用ioutil包下的API进行便捷的读取 阅读全文
posted @ 2019-11-30 16:11 Ethan_Cheng 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 输出: 阅读全文
posted @ 2019-11-26 08:41 Ethan_Cheng 阅读(196) 评论(0) 推荐(0) 编辑
摘要: 输出: 阅读全文
posted @ 2019-11-25 07:53 Ethan_Cheng 阅读(198) 评论(0) 推荐(0) 编辑
摘要: 输出: 阅读全文
posted @ 2019-11-24 23:24 Ethan_Cheng 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 结果: 阅读全文
posted @ 2019-11-21 23:49 Ethan_Cheng 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 接口的实现 接口的类型断言 空接口与空接口的类型断言 阅读全文
posted @ 2019-11-20 23:25 Ethan_Cheng 阅读(165) 评论(0) 推荐(0) 编辑
摘要: package main import ( "fmt" ) type Dog struct { Name string Age int } func (d *Dog)bite() { fmt.Printf("%s要咬你了\n", d.Name) } type PoliceDog struct { //一行代码拥有父类的全部成员(属性+方法) Dog //扩展出新的属性 ... 阅读全文
posted @ 2019-11-19 23:24 Ethan_Cheng 阅读(153) 评论(0) 推荐(0) 编辑
摘要: package main import ( "fmt" "math" "time" ) /* @闰年判断 ·封装一个函数判断某一个年份是不是闰年(整4不整百,或者整四百)(例如:公元4年是如年,公元100、200、300不是闰年,公元400年是闰年) ·计算一年的精确天数 @根据当前时间纳秒求年月日 ·time.Now().Unix()会返回距离1970年零时所逝去的时间秒数:1234... 阅读全文
posted @ 2019-11-18 23:01 Ethan_Cheng 阅读(429) 评论(0) 推荐(0) 编辑
摘要: package main import "fmt" /* 面向过程编程:调度大量的变量、函数 面向对象编程(OOP=Object Oriented Programming) 对象=结构体/类的实例 对象.属性(面向过程中调度变量) 对象.方法(面向过程中调度汗水) */ type Dog struct { //结构体的属性 name string age int gender bool //结构体 阅读全文
posted @ 2019-11-14 23:09 Ethan_Cheng 阅读(723) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 11 下一页