j. / go api← Back to architecture
BACKEND REFERENCE / GO · REST · TESTS

Small service.
Clear contracts.

A working Go HTTP service example with API validation, thread-safe in-memory state, structured JSON responses, unit tests, and a container build. You can inspect the source and run it locally.

Standalone code example · not a live production backend

What's inside

API design

Health checks, route methods, input validation, bounded requests, and explicit error responses.

Testing

Endpoint coverage, invalid payload cases, concurrent writes, and race detector checks.

Delivery

Non-root container image, graceful shutdown, and a standalone GitHub Actions template.

Read the code

Try it on your machine

# From the examples/go-api folder (Go 1.23+) go test -race ./... go run . # In another terminal curl http://localhost:8080/healthz curl -X POST http://localhost:8080/api/releases \ -H 'Content-Type: application/json' \ -d '{"service":"website","environment":"staging","version":"v1.2.0"}' curl http://localhost:8080/api/releases
This API stores sample records in memory. It does not authenticate users, persist to a database, launch cloud deployments, or connect to the Release Lab simulation. Those boundaries are intentional and documented.