
Generate a Sitemap in Go for a Dynamic Website Quickly
Generate sitemaps in Go for a dynamic site: encode URLs correctly, write honest lastmod dates, split at 50,000 URLs with an index and gzip the output.
Everything you need to level up your coding skills.

Generate sitemaps in Go for a dynamic site: encode URLs correctly, write honest lastmod dates, split at 50,000 URLs with an index and gzip the output.

Decode request JSON strictly in Go: DisallowUnknownFields, a single-value check, body limits and a map from decoder errors to 400, 413 and 422 answers.

Build an in-memory response cache for Go handlers with keys, a TTL, Vary awareness, a singleflight stampede guard and rules for what must never be cached.

Build an accessible templ form in Go with errors beside each field, kept values, a redirect after success and CSRF protection from Go 1.25.

Build short-lived JWT access tokens and rotating refresh tokens in Go: pinned verification, hashed storage, reuse detection and a concurrent refresh trap.

Twelve mistakes in Go HTTP servers that pass code review and fail under load or attack, each with the symptom, a reproduction where one fits, and the fix.

Build a JSON API in Go from a written contract: standard routing, one error format, strict decoding, validation, cursor paging, PATCH, auth and tests.

Build a WebSocket hub in Go with gorilla/websocket: origin checks, read limits, ping and pong, per client send queues and a rule for slow consumers.

Build a pastebin in Go on SQLite with unguessable IDs, expiry, burn after read that survives link previews, delete tokens and output that cannot run scripts.

Implement PATCH in a Go API with merge-patch semantics: tell absent, null and zero apart, apply only the keys sent and reject bad patches before any SQL runs.

Serve net/http/pprof from a separate loopback listener with a token, avoid the DefaultServeMux trap, and fix the WriteTimeout error on CPU profiles.

A practical templ tutorial for Go: write components in .templ files, generate Go code, compose layouts, serve them over HTTP and test the output.
We send one email when a new article is published. No spam.