Example structure to start a microservices project with golang. Using a MySQL database.
If you would still prefer to do the installation manually, follow these steps:
Clone the repo:
git clone https://github.com/gbrayhan/microservices-go
If you need, configure the environment variables in file config.json, if you use docker-compose leave the variables set in the file config.json.example
cp config.json.example config.json
- Features
- Commands
- Environment Variables
- Project Structure
- API Documentation
- Error Handling
- Validation
- Linting
- Golang v1.14: Stable version of go
- Framework: A stable version of gin-go
- SQL database: MariaDB using internal sql package of go sql
- Testing: unit and integration tests using package of go testing
- API documentation: with swaggo a go implementation of swagger
- Dependency management: with go modules
- Environment variables: using viper
- Docker support
- Code quality: with CodeFactor
- Linting: with ESLint
docker-compose up --build -d
swag init -g routes/ApplicationV1.go
# run recursive test
go test ./test/unitgo/...
# clean go test results in cache
go clean -testcache
golangci-lint run ./...