
Web
ResponseController in Go 1.20 for Flush and Deadlines
Use http.ResponseController from Go 1.20 to flush streaming responses, move write deadlines per handler and hijack connections, with a Flush demo.
3 min read
Tag
4 articles

Use http.ResponseController from Go 1.20 to flush streaming responses, move write deadlines per handler and hijack connections, with a Flush demo.

Build a Go program with go build -cover, run it several times with GOCOVERDIR, then merge the runs and read the percentages with go tool covdata.

Use context.WithCancelCause and context.Cause from Go 1.20 to record why a context ended, with timeout causes from Go 1.21 and a fan-out pattern.

Combine several errors into one with errors.Join in Go 1.20 and later: how it prints, how Is and As search it, and how it handles nil values and cleanup.