Reload go application in real time

Time:2021-10-26

brief introduction

1. You can implement live reload of go code
2. Based onfreshNo maintenance, no developmentair

characteristic

  • Colorful log output
  • Customize build or binary command
  • Support excluding subdirectories
  • Allow watching new directories after Air started
  • Better building process

install

go get -u github.com/cosmtrek/air

use

air

Output:

Reload go application in real time

1. Because MySQL service is not enabled locally, there is a link error.
2. Air will detect the changes of other files. Once other files are changed, it will compile automatically
3. Air has nothing to do with the hot deployment of the production environment.


go

This work adoptsCC agreement, reprint must indicate the author and the link to this article

A pawn in the arch of the sun can’t make a contribution