Go 语言中gin 开发热更新

问题 : 有没有方法可以热更新

方法一 :    go get github.com/pilu/fresh  
安装之后 在项目根目录 输入  fresh 回车 即可运行

E:\Go\src\api.jwcode.com>fresh
19:3:23 runner      | InitFolders
19:3:24 runner      | mkdir ./tmp
19:3:24 runner      | mkdir ./tmp: Cannot create a file when that file already exists.
19:3:24 watcher     | Watching .
19:3:24 watcher     | Watching Controller
19:3:24 watcher     | Watching Controller\admin
19:3:24 watcher     | Watching Controller\hope
19:3:24 watcher     | Watching Controller\index
19:3:24 watcher     | Watching Models
19:3:24 watcher     | Watching View
19:3:24 watcher     | Watching View\后台
19:3:24 watcher     | Watching common
19:3:24 watcher     | Watching conf
19:3:24 watcher     | Watching middleware
19:3:24 watcher     | Watching routers
19:3:24 main        | Waiting (loop 1)...
19:3:24 main        | receiving first event /
19:3:24 main        | sleeping for 600 milliseconds
19:3:24 main        | flushing events
19:3:24 main        | Started! (38 Goroutines)
19:3:24 main        | remove tmp\runner-build-errors.log: The system cannot find the file specified.
19:3:24 build       | Building...
19:3:25 runner      | Running...
19:3:27 main        | --------------------
19:3:27 main        | Waiting (loop 2)...
19:3:27 app         | [GIN-debug] [WARNING] Creating an Engine instance with the Logger and Recovery middleware already attached.

19:3:27 app         | [GIN-debug] [WARNING] Running in "debug" mode. Switch to "release" mode in production.
 - using env:   export GIN_MODE=release
 - using code:  gin.SetMode(gin.ReleaseMode)

[GIN-debug] POST   /wish/getAll              --> api.jwcode.com/Controller/hope.Total (4 handlers)
[GIN-debug] POST   /wish/send                --> api.jwcode.com/Controller/hope.Save (4 handlers)
[GIN-debug] POST   /BackstageIndexLogin      --> api.jwcode.com/Controller/admin.Login (4 handlers)
[GIN-debug] POST   /BackstageIndexRegister   --> api.jwcode.com/Controller/admin.Register (4 handlers)
[GIN-debug] POST   /Backstage/AdminUserInfo  --> api.jwcode.com/Controller/admin.UserInfo (5 handlers)
[GIN-debug] GET    /index/index/index        --> api.jwcode.com/Controller/index.Short (4 handlers)
[GIN-debug] Listening and serving HTTP on :9090


方法二: (持续更新中...)

...


伍先生
  • 职业: 程序员,产品
  • 码龄: 4.1
  • 技能: PHP Go 前端
  • 微信: JwCode
  • 公众号/小程序: 渐悟分享