
Templ Mistakes With Escaping and Raw HTML in Components
Where templ escapes for you and where it does not: URLs, SafeURL, style strings, Raw, script data and event handlers, shown with real output and tests.
Everything you need to level up your coding skills.

Where templ escapes for you and where it does not: URLs, SafeURL, style strings, Raw, script data and event handlers, shown with real output and tests.

Serve large files from Go with http.ServeContent so browsers can resume downloads and seek in video, and see exactly what each Range header gets back.

Build a webhook receiver in Go that checks an HMAC signature on the raw body, rejects stale and replayed events, answers fast and processes in the background.

Compare URL, header, media type and date-based API versioning in Go, with one handler serving two views, a frozen v1 test and Sunset headers.

Replace the plain text 404 and 405 responses of http.ServeMux with your own pages or JSON, using a catch-all route and a small response wrapper.

Fix listen tcp bind address already in use in a Go server: find the process holding the port, handle containers and restarts, and use port 0 in tests.

Generate a Go net/http server from an OpenAPI file with oapi-codegen: config, the interface, validation middleware and what generated code leaves unchecked.

Build a typed Go client for a JSON API: context on every call, one generic request helper, an APIError you can test with errors.Is, and paging as an iterator.

Compare templ and html/template on the same 100 row page: render speed and allocations, error timing, escaping, tooling and when each is the right choice.

Make JSON API revalidation cheap in Go: ETags from a revision column, collection tags, exact If-None-Match matching, 304 headers and 10x less work.

Give HTTP handlers their database, logger and clients through struct fields or closures, wire everything in main, test with fakes and avoid globals.

Validate Go API requests with a small collector: JSON Pointer paths, nested fields, cross-field rules, rune-aware lengths and 340 ns for a valid order.
We send one email when a new article is published. No spam.