backend-golang
SKILL.md
Backend - Go (Gin/Echo)
When to use this skill
- Building or updating Go HTTP APIs using Gin or Echo.
- Adding routes/handlers/middleware, validation, logging, or persistence.
- Improving performance, observability, security, or testing for Go services.
Quick start
- Install deps:
go mod tidy(orgo mod download). - Env: copy
.env.example->.envif present; load viagodotenv/config; set DB URLs, secrets, and service endpoints. - Run:
go run ./...or service-specificmake devif provided. - Test:
go test ./...; lint/format:golangci-lint runandgofmt -w/go fmt ./.... - Build:
go build ./cmd/...or project entry.
Project structure basics
cmd/<service>/main.go: entrypoint; wire router, middleware, config, logger, DI.internal/orpkg/: handlers, services/usecases, repositories, domain models, DTOs.configs/: config files; prefer typed config structs with validation.migrations/: SQL/DDL migrations if applicable.