INDEPENDENT NOTES ON CODE & THE WEBGO · HTML · CSS
small systems
The notebook / Go

Go, one useful piece at a time

HTTP services, useful error messages, and tests that describe the behavior of your code.

Go

A small HTTP server, without a framework

Start with the standard library. Add a route, return JSON, and give every request a sensible time limit.

3 min read
Go

Errors that keep their context

Return useful errors from the place where something failed, and handle them where a decision can be made.

3 min read
Go

Test an HTTP handler without opening a port

Use httptest to verify the contract a caller sees: status, headers, and response data.

3 min read