Back to Templates
Go Microservice
Go Microservice Starter with Gin, gRPC, Wire & Docker
Go with Gin, gRPC, Wire DI, testing, and Docker
terminal
npx setupkaro init my-svc --template go-microserviceZero installNo telemetryMIT License
What's Included
- Gin (HTTP) + gRPC (grpc-gateway) — single server, dual protocol
- Google Wire for compile-time dependency injection
- testify + testify/suite + mockery for mocks
- golangci-lint (errcheck, govet, staticcheck, gosec, revive, etc.)
- GitHub Actions: vet, lint, test -race, build, docker
- Multi-stage Dockerfile (distroless/static) + docker-compose
- go.mod with pinned dependencies and replace directives for Wire
- Generated README with make targets and project structure
Generated Folder Structure
cmd/server/main.gowire.gowire_gen.gointernal/handler/service/repository/config/proto/service.prototests/integration_test.go.github/workflows/ci.ymlDockerfiledocker-compose.ymlgo.modgo.sumMakefilegolangci-lint.ymlREADME.md
Quick Start Commands
Generate Project
terminal
npx setupkaro init my-svc --template go-microserviceNext Steps
cd my-app
go mod tidy
go run ./cmd/server
Frequently Asked Questions
- Why Wire for DI instead of manual wiring?
- Wire generates code at compile time — no runtime reflection, no startup overhead, and compile-time safety.
- Does it include a database layer (GORM, sqlx)?
- The template shows a repository pattern interface. Add your preferred ORM/driver after generation.
- What about configuration (Viper, envconfig)?
- The template uses a simple config struct with environment variables. Extend with Viper if needed.
- Can I use this for a monolith instead of microservice?
- Yes — the structure works for any Go service. Remove the gRPC parts if HTTP-only.
Generate Another Template
React + TypeScript
Vite + React + TS with Tailwind and React Router
terminal
npx setupkaro init my-app --template react-tsReplace my-app with your project name.
Ready to generate your Go Microservice project?
One command. Production-ready. Start building in seconds.
terminal
npx setupkaro init my-svc --template go-microservice