Using Hot Reload in Go Application

Learn how to use a hot reload mechanism in a Go Application.

We'll cover the following

Use hot reload

Hot reload mode can be enabled while creating applications in Go. The hot reload reloads the application if changes occur in the source code. To enable hot reload, we install a library called air with the following command (this command is available in Go version 1.16 or above):

go install

Check the installation with the following command:

air -v

Initialize the hot reload configuration with the following command:

air init

We create the hot reload configuration file i in the .air.toml file. To run the application with a hot reload mechanism, we use the air command.


The hot reload is enabled in the application. We try to make changes in the source code, then save it. If the changes are detected, the application will be reloaded.

Get hands-on with 1200+ tech skills courses.