Shanraq.org Shanraq.org

Publishing archive

Saturday, 5 September 2026

Saturday

September 2026
MonTueWedThuFriSatSun
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

The highlighted days are the ones with something published; those are clickable.

IT

Errors and logs in Go: seeing what broke

The twenty-fifth lesson of the Go course. A panic in a handler does not bring the server down — it brings the answer down, and the reader gets nothing at all. recover in one wrapper, a reference number on the page and in the log, log/slog instead of printing to the console, and why an answer that has already left cannot be rescued.

IT

Static files in Go: CSS, fonts and images

The twenty-fourth lesson of the Go course. The site starts to look like something instead of merely working. http.FileServerFS, why files from disk need StripPrefix and embedded ones do not, where Content-Type comes from, why the whole static folder is on show, and why the browser downloads an embedded file again every single time.

IT

Forms in Go: taking what the reader sent

The twenty-third lesson of the Go course. For the first time data travels the other way — from the reader to the server. The method and the field names, r.FormValue, why a check in the browser is not protection, and why a handler that changed something answers with a redirect instead of a page: otherwise F5 adds a second article.

IT

Templates in Go: html/template and a page instead of strings

The twenty-second lesson of the Go course. HTML moves out of the code into a file of its own: the dot as the name of the data, range over a slice, if and else. Why html/template makes somebody else's text safe for you, why templates are parsed once at start-up, and why a page is assembled in a buffer rather than straight into the response.

IT

Handlers and middleware: one wrapper for every route

The twenty-first lesson of the Go course. A wrapper around the router does the same thing for every request: a log line, a response time, a check. What http.Handler is, why a wrapper takes a handler and returns a handler, which order two of them run in, and how to learn the status code that ResponseWriter refuses to hand back.

IT

Routing in Go: who handles which address

The twentieth lesson of the Go course. ServeMux sends requests to handlers: the method and the path are written on one line, {slug} pulls a piece out of the address, and {$} stops the front page from catching everything. The router answers 404 and 405 on its own, and two patterns that conflict are caught at start-up rather than in production.

IT

HTTP for real: method, path, headers and status code

The nineteenth lesson of the Go course and the start of the module on the web. A request is a struct you can read: method, path, headers, parameters. A response goes out one way — headers, status, body, in that order. What happens to a header set too late, why 404 and 405 are different answers, and what the superfluous WriteHeader message means.