CRUD API unit-testing example

Example API built with:

Installation

Install go dependencies:

go mod vendor

Generate mocks

Make sure you have mockery installed:

go install github.com/vektra/mockery/v2@v2.20.0

or

brew install mockery
brew upgrade mockery

Generate mocks:

make mocks

Generate swagger:

go install github.com/swaggo/swag/cmd/swag@latest
make docs

Environment variables:

Create .env:

cp .env.example .env

Run:

make run

Test:

make test