Go: a request ID on every log line with log/slog, without passing a logger around
The single most useful field in a production log is the one that lets you pull every line belonging to one request.
Most Go codebases get there by threading a *slog.Logger through every function signature, or by stuffing the logger
into the context and fishing it out everywhere. There is a cleaner way that the slog design makes almost trivial:
a Handler that reads the request ID from the context.Context it is given. Then every call site is just
slog.InfoContext(ctx, ...), and the ID appears on its own.