[Tutorial] Update Air and Rebuild with the Latest Go - dejurin/blog GitHub Wiki

Here’s a clean step-by-step tutorial in English on how to update [Air](https://github.com/air-verse/air) and rebuild it with a newer Go toolchain (example: Go 1.25.1).


🔧 Tutorial: Update Air and Rebuild with the Latest Go

1. Check Your Current Go Version

go version

Example output:

go version go1.24.6 darwin/arm64

If it’s not the version you need, upgrade first.


2. Install or Upgrade Go

Download from the [official Go site](https://go.dev/dl/). For Linux/macOS:

wget https://go.dev/dl/go1.25.1.linux-amd64.tar.gz
sudo rm -rf /usr/local/go
sudo tar -C /usr/local -xzf go1.25.1.linux-amd64.tar.gz

Add Go to your PATH (if not already):

export PATH=$PATH:/usr/local/go/bin

Verify:

go version
# go version go1.25.1 linux/amd64

3. Remove the Old Air Binary

Air may still be compiled with the old Go version. Remove it to avoid confusion:

rm -f ~/go/bin/air

4. Clean Go Caches (Optional but Recommended)

go clean -cache -modcache

5. Install Air with the New Go Toolchain

go install github.com/air-verse/air@latest

This fetches the latest release and builds it with your currently active Go version (e.g. Go 1.25.1).


6. Verify Installation

which air
air -v

Expected output:

/Users/you/go/bin/air
air version v1.62.0, built with Go go1.25.1

7. (Optional) Automate with a Makefile

Create a Makefile in your project root:

GO ?= go

air-update:
	@rm -f $$HOME/go/bin/air
	@$(GO) clean -cache -modcache
	@$(GO) install github.com/air-verse/air@latest
	@echo "Air updated with $$(go version)"

air-version:
	@which air
	@air -v

Now you can run:

make air-update
make air-version

✅ Summary

  • Upgrade Go first (download & install).
  • Remove old Air binaries.
  • Reinstall Air with go install to compile it against the new Go version.
  • Verify with air -v.
  • Optionally, automate updates using a Makefile or script.