Repository navigation
Releases
Releases · antoniopaya22/go-rest-template
v3.0.1
v3.0.0
3.0.0 (2026-11-16)
⚠ BREAKING CHANGES
- the HTTP API, the configuration variables and the database schema are not compatible with 2.x. See the migration guide.
Features
- add the init tool and the resource generator (122950b)
- rewrite the core around feature packages (4247ac9)
Bug Fixes
- repair the Docker build and harden CI (#12) (f06c837)
- return timestamps in UTC on every database driver (b586f75)
Documentation
v2.0.1 — Security fixes
Security release. Upgrading is recommended for every project based on this template.
Security
- Client IP spoofing:
chi'smiddleware.RealIPtrustedX-Forwarded-For/X-Real-IPheaders that clients can forge (GHSA-3fxj-6jh8-hvhx). The router now resolves the client IP from the TCP peer by default, or from the entry added by your own proxies whenHTTP_TRUSTED_PROXIESis set. Request logs use the resolvedclient_ip. - Vulnerable dependencies:
govulncheckreported 8 reachable vulnerabilities (chi, kin-openapi, pgx, x/text) plus others inx/cryptoandx/sys. All direct dependencies are upgraded;govulnchecknow reports none affecting the code.
Tooling
- CI runs
govulncheckand uses the latest Go 1.26 patch release. - CodeQL code scanning, OpenSSF Scorecard and grouped Dependabot updates.
SECURITY.mdwith private vulnerability reporting.
Upgrade notes
- New optional setting
HTTP_TRUSTED_PROXIES(default0). Set it to the number of reverse proxies in front of the API if you need the real client IP behind a load balancer.
Full changelog: 2.0.0...2.0.1
v2.0.0 — Modern Go 1.26 rewrite
A complete rewrite of the template on modern Go. The legacy Gin-based v1 remains available in the 1.0.0 tag.
Highlights
- Go 1.26, standard-library-first bootstrap with graceful shutdown
- chi router with request IDs, timeouts, structured
sloglogging and CORS - OpenAPI 3.1 contract as the source of truth, with request and response validation and interactive docs at
/docs - JWT authentication (
golang-jwt/jwt/v5) and a first-admin bootstrap flow - PostgreSQL for production (
pgx/v5) with SQLite kept for local development, plus versioned migrations - Service and repository layers with explicit
context.Contextpropagation - Health endpoints (
/health/live,/health/ready), Prometheus metrics and optional pprof - Table-driven unit tests, integration tests against PostgreSQL,
go vet,golangci-lintand GitHub Actions CI
Breaking changes
- Gin has been replaced by chi; the HTTP layer, project layout and configuration are new.
- The Go module path is now
github.com/antoniopaya22/go-rest-template(previouslygithub.com/antonioalfa22/go-rest-template).
Other
- Licensed under MIT.
Full changelog: 1.0.0...2.0.0