github
zxysilent/fishgithub.com![c80603f28a74722f28c2768d5766cbf2.png](https://i-blog.csdnimg.cn/blog_migrate/045e882873ddf06577ba51209c0a68d1.png)
fish
fish 是一个方便开发go程序的工具。
监视文件修改,然后编译go程序并自动运行。
要求
- Go version >= 1.3.
安装
go get github.com/zxysilent/fish
确保 fish.exe
所在路径在你的环境变量里面
如果配置了 GOPATH
环境变量 fish.exe
默认在 GOPATH/bin
请确保 GOPATH/bin
在你的环境变量里
升级
go get -u github.com/zxysilent/fish
基本命令
version 打印版本信息
run 热重载,监听 .go 文件变化,自动编译并运行
fish version
打印版本信息
$ fish version
____ _ __
/ __/ (_) ___ / /
/ _/ / / (_-< / _
/_/ /_/ /___/ /_//_/ v0.3.0
├── Go : go1.14
├── GOOS : windows
├── GOARCH : amd64
├── NumCPU : 4
├── GOPATH : D:AppGo
├── GOROOT : D:Program FilesGo
└── Date : 2020-02-27 15:15:52
fish run
热重载,监听 .go 文件变化,自动编译并运行
$ fish run
2020/02/27 15:19:34 INFO ▶ 00001 Using 'blog' as app name
2020/02/27 15:19:34 INFO ▶ 00002 Loading watcher...
2020/02/27 15:19:34 INFO ▶ 00003 Watching: D:AppGosrcblogconf
2020/02/27 15:19:34 INFO ▶ 00004 Watching: D:AppGosrcblogcontrol
2020/02/27 15:19:34 INFO ▶ 00005 Watching: D:AppGosrcblog
2020/02/27 15:19:34 INFO ▶ 00006 Watching: D:AppGosrcblogmodel
2020/02/27 15:19:34 INFO ▶ 00007 Watching: D:AppGosrcblogrouter
2020/02/27 15:19:35 SUCC ▶ 00008 Built successfully
2020/02/27 15:19:35 INFO ▶ 00009 Starting 'blog.exe'
2020/02/27 15:19:35 SUCC ▶ 00010 './blog.exe' is running
⇨ http server started on [::]:88