random thoughts a journey to somewhere

random thoughts — a journey to somewhere

Structured Logging in Go with log/slog

Getting started with log/slog, Go 1.21's standard-library structured logger — levels, handlers, wrapping the logger, writing to a file, and go vet gotchas. Read more

Trace Logging in Golang

Add a TRACE log level to a Go program to observe code execution paths, using runtime caller info to report the file and line that logged. Read more

Signal Handling and Graceful Shutdown in Go

Graceful shutdown in Go

Catch SIGINT and SIGTERM in Go, broadcast the shutdown to every goroutine, unblock blocking calls and shut down an HTTP server cleanly. Read more

Working with SSH in Linux and macOS

Generate SSH keys, load them into ssh-agent, set up password-less login, clean up known_hosts and tame your ~/.ssh/config on Linux and macOS. Read more

Symmetric Encryption with ChaCha20-Poly1305 in Go

Symmetric encryption with ChaCha20-Poly1305

A practical guide to authenticated symmetric encryption in Go using ChaCha20-Poly1305 — keys, nonces, where to store them, and full working code. Read more