This is a project for Go API use :
$ git clone https://github.com/FournyP/go-api-template
$ cd go-api-template
$ git remote set-url origin <YOUR REPOSITORY URL>
- Open
go.mod
file - Replace
go-api-template
by your module name - Correct import in files (You can use VS Code to do it)
$ cp .env.example .env
- Open database.go file
- Uncomment the driver you want to use
- Run
go mod tidy
to download the driver and automatically install dependencies
$ go run .
$ go build .