Air
Air is a Golang server hot reload tool.
Installation
Follow the official instruction, using the go install
which is recommanded by official docs.
go install github.com/air-verse/air@latest
Configuration
-
Identify where the air binary file was just installed. It may not be install at
~/.air
-
In my case, it's installed at
~/go/bin/air
. Therefore, we'll need to move this file to~/.air
mv ~/go/bin/air ~/.air
-
Setting the alias in
./.zshrc
as stated in the docsalias air='~/.air'
Reference for zsh configuration: https://github.com/air-verse/air/issues/135
Start using it
-
initailization
-
use existed air config file:
air -c .air.toml
-
or initial one with defaults:
air inti
-
-
start
air