Skip to content

Instantly share code, notes, and snippets.

@tenthree
Created December 19, 2019 06:39
Show Gist options
  • Save tenthree/ddb14c57c29d36dc6d273222c434adb8 to your computer and use it in GitHub Desktop.
Save tenthree/ddb14c57c29d36dc6d273222c434adb8 to your computer and use it in GitHub Desktop.
air configuration, a live reload tool for go development
# Config file for [Air](https://github.com/cosmtrek/air) in TOML format
# Working directory
# . or absolute path, please note that the directories following must be under root
root = "."
# Optional! If `watch_dir` is empty, use `root`.
watch_dir = ""
tmp_dir = "tmp"
[build]
# Just plain old shell command. You could use `make` as well.
cmd = "go build -race -o ./tmp/main.exe"
# Binary file yields from `cmd`.
bin = ".\\tmp\\main.exe"
# Customize binary.
full_bin = ".\\tmp\\main.exe"
# This log file places in your tmp_dir.
log = "air_errors.log"
# Watch these filename extensions.
include_ext = ["go", "tpl", "tmpl", "html"]
# Ignore these filename extensions or directories.
exclude_dir = ["assets", "tmp", "vendor", "frontend/node_modules"]
# It's not necessary to trigger build each time file changes if it's too frequent.
delay = 1000 # ms
[log]
# Show log time
time = false
[color]
# Customize each part's color. If no color found, use the raw app log.
main = "magenta"
watcher = "cyan"
build = "yellow"
runner = "green"
[misc]
# Delete tmp directory on exit
clean_on_exit = true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment