air 监听go,实时编译
最后更新于:2022-04-02 02:52:11
[TOC]
[github](https://github.com/cosmtrek/air/)
## 安装
### macOS
```
curl -fLo ~/.air https://raw.githubusercontent.com/cosmtrek/air/master/bin/darwin/air
chmod +x ~/.air
```
### Linux
```
curl -fLo ~/.air https://raw.githubusercontent.com/cosmtrek/air/master/bin/linux/air
chmod +x ~/.air
```
### Windows
```
curl -fLo ~/.air.exe https://raw.githubusercontent.com/cosmtrek/air/master/bin/windows/air.exe
```
### docker
```
docker run -it --rm \
-w "/go/src/github.com/cosmtrek/hub" \
-v $(pwd):/go/src/github.com/cosmtrek/hub \
-p 9090:9090 \
cosmtrek/air
```
## 使用
> [默认配置](https://github.com/cosmtrek/air/raw/master/air.conf.example)
在项目根路径 添加 .air.conf文件
`执行 air`
';