Limit goroutines with buffered channels

Control goroutine concurrency with buffered channels as semaphores. Prevent resource exhaustion with backpressure patterns in Go workers.

Structured Logging with slog

The Go 1.21 standard library includes a new structured logging package, log/slog.

A brief and incomplete history of modal text editors

In this post I’m going to talk about some old text editors you probably never heard of, what is modal text editing, and why people like it so much.

Writing a TOTP client in Go

A TOTP1 based 2FA system has two parts. One is a client that generates the TOTP code. The other part is a server. The server verifies the code. If the client and the server-generated codes match, the server allows the inbound user to access the target system. The code usually exp...

Writing a TOTP client in Go

A TOTP based 2FA system has two parts. One is a client that generates the TOTP code. The other part is a server. The server verifies the code. If the client and the server-generated codes match, the server allows the inbound user to access the target system. The code usually expi...

Writing a TOTP client in Go

A TOTP based 2FA system has two parts. One is a client that generates the TOTP code. The other part is a server. The server verifies the code. If the client and the server-generated codes match, the server allows the inbound user to access the target system. The code usually expi...

Writing a TOTP client in Go

Build a TOTP-based 2FA client in Go using the standard library. Generate time-based one-time passwords like Google Authenticator.

C and C++ Prioritize Performance over Correctness

The meaning of “undefined behavior” has changed significantly since its introduction in the 1980s.

C and C++ Prioritize Performance over Correctness

The meaning of “undefined behavior” has changed significantly since its introduction in the 1980s.

Running commands against every module in a Go multi-module project

I've recently been migrating oapi-codegen to a multi-module project. As part of it I've seen that running an innocuous "test all the packages below this one": go test ./... Does not work any more, as go test will only traverse packages that the current module knows abou...