Install
go get github.com/cosmtrek/air
use
air init
Create a default configuration file under the project.air.toml
- Adjust configuration items
cmd = "go build -o tmp/${PWD##*/} ." #编译命令,二进制以项目为名输出到tmp目录下
bin = "tmp/${PWD##*/}" #二进制导出路径
include_ext = ["go", "html"] #监控文件类型
exclude_dir = ["tmp", "vendor"] #监控剔除目录
tmp_dir = "tmp" #air临时文件输出目录(需要git忽略)
clear_on_rebuild = true
- Start hot reload monitoring
air [-c .air.toml]
{{o.name}}
{{m.name}}