In this repository you will find a template for creating a Go backend project. It includes the entrypoint of the application, testing, linter and docker already configured.
- Go as programming language
- Gin as web framework
- Testify. A toolkit with common assertions and mocks that plays nicely with the standard library
- Golangci-lint as linter and formatter
- Docker as containerization tool
- Github Actions for CI (Continuous Integration)
- Taskfile for task automation
# Install dependencies
task deps
# Run the application
task run
# Build the application
task build
# Run the application with the binary
task start
# Build the image
docker build -t <owner>/go-api-template:<tag> .
# Run the container
docker run --rm -p 8080:8080 <owner>/go-api-template:<tag>
# Run tests
task test
# Run linter (if you have golangci-lint installed)
task lint
# Run linter (with docker)
task lint:docker