随笔分类 -  go

摘要:func tickDemo() { ticker := time.Tick(time.Second) //定义一个1秒间隔的定时器 for i := range ticker { fmt.Println(i)//每秒都会执行的任务 } } 阅读全文
posted @ 2022-03-03 20:49 bingxingc 编辑
摘要:1、下载 go get github.com/pilu/fresh 2、在项目里执行命令 fresh 阅读全文
posted @ 2022-02-06 20:28 bingxingc 编辑
摘要:1、安装 go get -u github.com/gin-gonic/gin 2、在go.mod写入代码 : require github.com/gin-gonic/gin v1.7.7 3、更新下mod包,test为项目名 go mod init test go mod tidy 5、引入gi 阅读全文
posted @ 2022-01-30 16:24 bingxingc 编辑
摘要:go语言 JSON 读写到文件 func readFile() { filePtr, err := os.Open("person_info.json") if err != nil { fmt.Println("Open file failed [Err:%s]", err.Error()) re 阅读全文
posted @ 2022-01-11 03:33 bingxingc 编辑
摘要:print("\033[H\033[2J") 阅读全文
posted @ 2022-01-02 23:47 bingxingc 编辑

点击右上角即可分享
微信分享提示