Make sure if air live-reloading is installed
Air is yet another live-reloading command line utility for developing Go applications. Run air in your project root directory, leave it alone, and focus on your code.
To install air you can execute the curl below
curl -sSfL https://raw.githubusercontent.com/air-verse/air/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
Note: to run with air right now we need run api without docker and database with docker
$ docker compose up
$ air
$ docker compose up
go run cmd/server/main.go
- Uncomment a block of lines at docker-compose
# go-admin:
# build:
# context: .
# dockerfile: ./Dockerfile
# ports:
# - 3333:8080
# env_file:
# - ./.env
# networks:
# - go-admin-network
# depends_on:
# mysql-go-admin:
# condition: service_healthy
- Build the image
docker build -t go_admin .
- Run Project
docker run -p 8080:8080 go_admin
go test ./...