git clone [email protected]:la-haus/golang-base-project.git $GOPATH/src/github.com/la-haus/sample
cd $GOPATH/src/github.com/la-haus/sample
- go v1.16+
- go module
- mockery
- swag
- Copy the sample configuration file and fill the right values according to your environment
cp .env.sample .env
- Install dependencies:
go mod download
- Generate Swagger doc:
go get github.com/swaggo/swag/cmd/swag
swag init -g router/router.go
- Run test:
go test ./...
- How to (re)generate mocks using Mockery tool:
mockery --all --dir interfaces --output ./tests/mocks
Then, once app is up and running, you can go to http://<host>
:<port>
/api/sample/docs/index.html
SERVER_HOST
: Host for the serverSERVER_PORT
: Port for the serverDD_ENV
: Datadog environment, values can bestaging
orproduction
DD_SERVICE
: Datadog service nameDD_VERSION
: Datadog service versionDATADOG_AGENT_HOST
: Datadog agent hostnameDATADOG_AGENT_PORT
: Datadog agent port
- Luis Pereira
This project is property of La Haus