Maybe your first option is:
- Execute with go run
- I have a Makefile, so I only need to run make build
The previous isn’t bad, it works but you lost time in start, stop the process, move to the terminal, etc.
I present AIR that reloads your changes when you codding. Air it's used in your machine or inside the docker.
- Install air in your machine
- Inside docker
Example: 1
# air is installed in your machine
$ air main.go
Example: 2
# air is installed in your docker image
$ docker-compose up
For each change that you make applies the refresh
Happy coding!