feat(Go-StudyExample):2020/12/28:新增【Go每日一库】air监听程序文件变化,主动重启工程

This commit is contained in:
Huangzj
2020-12-28 16:01:28 +08:00
parent cdc446fe8a
commit 19d04f5dcb
4 changed files with 22 additions and 4 deletions
+12
View File
@@ -0,0 +1,12 @@
获取命令: go get github.com/cosmtrek/air
参考:https://github.com/darjun/go-daily-lib
参考:https://segmentfault.com/a/1190000025186913
## 使用说明
air -c example.toml 是按照配置进行启动,可以查看github该工程的配置,但是我这边按照配置启动一直是失败的状态,没有去深究。
这边直接在【Terminal】上面输入 【air】命令也可以正常启动,他会找到最外层的main.go函数进行执行
当本工程中任意一个文件进行修改【保存】,都会触发重启操作,也就是说省去了重启的过程(监听程序文件的变化)
+3 -1
View File
@@ -1,3 +1,5 @@
获取包命令: go get github.com/uniplaces/carbon
参考 go每日一库:https://github.com/darjun/go-daily-lib
参考 go每日一库:https://github.com/darjun/go-daily-lib
参考文章:https://segmentfault.com/a/1190000021754301
+3 -1
View File
@@ -4,4 +4,6 @@ To..方法直接返回转换后的类型
To..E方法,返回转换后的类型和报错信息
参考 go每日一库:https://github.com/darjun/go-daily-lib
参考 go每日一库:https://github.com/darjun/go-daily-lib
参考文章:https://segmentfault.com/a/1190000021684109
+4 -2
View File
@@ -31,9 +31,11 @@ json与struct之间转换处理工具使用示例
2020/12/25:新增leetcode部分习题(数据结构、二进制相关)
2020/12/25: 新增carbon时间操作库使用示例
2020/12/25: 新增【Go每日一库】carbon时间操作库使用示例
2020/12/28:新增cast类型转换工具包
2020/12/28:新增【Go每日一库】cast类型转换工具包
2020/12/28:新增【Go每日一库】air监听程序文件变化,主动重启工程
# mod vendor模式加载包
通过go mod的方式加载的github上面的包会有报红的问题,但是包本身是可以运行的,这样就是会有一个问题,如果你想要点击去看方法的内容,没办法做到