Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Go Http Services?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/adityaaatiwari-go-http-services)
---
description: Build production Go HTTP servers using net/http, chi/mux middleware, explicit timeouts, and graceful shutdown
profile: standard
tags: go, http, backend, api
---
# Go HTTP services
Use when implementing HTTP handlers, routing, or server lifecycle code in Go.
## Server setup
- Never use `http.ListenAndServe` or `http.DefaultClient`; configure `http.Server` with `ReadHeaderTimeout`, `ReadTimeout`, `WriteTimeout`, and `IdleTimeout`.
- Propagate `r.Context()` into every database, cache, and outbound HTTP call so client disconnects cancel downstream work.
- Handle `SIGINT`/`SIGTERM` with `signal.NotifyContext` and `server.Shutdown(ctx)` to drain in-flight requests cleanly.
## Handlers and middleware
- Read request bodies through `http.MaxBytesReader` to bound memory allocation on malformed payloads.
- Write structured middleware for request IDs, panic recovery, and latency metrics without mutating global state.
- Map domain errors to consistent JSON status codes in one helper rather than calling `http.Error` ad hoc.
## Verify
Run `go test -race ./...` using `httptest.NewRequest` and `httptest.NewServer` for routing, timeouts, and shutdown.