Scaffold production-ready Go services in seconds.
go install github.com/nghiack7/goforge@latest# REST API (default)
goforge new myapi
# gRPC service
goforge new myservice --template grpc
# Background worker
goforge new myworker --template workergoforge list| Template | Description |
|---|---|
rest-api |
REST API with health check, graceful shutdown, structured logging, Dockerfile, Makefile |
grpc |
gRPC service with health check, proto scaffold, graceful shutdown, Dockerfile |
worker |
Background worker with ticker loop, health endpoint, graceful shutdown, Dockerfile |
- Structured logging (
log/slogwith JSON output) - Graceful shutdown (SIGINT/SIGTERM handling)
- Health check endpoint
- Dockerfile (multi-stage build)
- Makefile (build, run, test, lint, docker)
.gitignore
myapi/
├── main.go # Entry point with graceful shutdown
├── go.mod
├── Dockerfile
├── Makefile
├── .gitignore
└── internal/
├── config/
│ └── config.go # Environment-based configuration
└── handler/
└── handler.go # HTTP handlers with health check
git clone https://github.com/nghiack7/goforge.git
cd goforge
go build ./...
go test ./... -v -raceMIT