Nick's website

Projects

This is a list of my open source projects. Most are licensed under MPL 2.0, which is my go-to license these days.

env

Source | Documentation | Stack: Go

🔍 Load environment variables into a config struct

I wasn't happy with the mainstream configuration libraries for Go because I find them bloated with features (looking at you, Viper). Being a fan of the 12factor methodology, I decided to write a simple alternative that focuses on environment variables.

queries

Source | Documentation | Stack: Go

🛢️ Convenience helpers for working with SQL queries

This package is an all-in-one toolset for working with database/sql. First, it has a query builder that, unlike others, is based on string formatting. Think of it as fmt.Sprintf that supports special verbs for query arguments. Second, it has a row scanner, a minimalist alternative to sqlx. Finally, it has a gRPC-like interceptor for sql.DB, which allows you to plug in observability without using wrappers.

sloglint

Source | Documentation | Stack: Go

🪵 Ensure consistent code style when using log/slog

I was excited when structured logging finally made it into the standard library. I was less excited about some of the API choices made, specifically supporting two argument types behind ...any. Since it's common to fix Go problems with static analysis (see vet checks), I decided to take the same approach to improve the use of log/slog in production. Today, with many useful checks added, I consider sloglint a good supplement to log/slog.

musttag

Source | Documentation | Stack: Go

🚔 Enforce field tags in (un)marshaled structs

This linter is a bit more opinionated, but I find it useful for projects involving external communication. The idea is that when Go struct tags define a contract between parts of the system (e.g. the json tag for a REST API), they should be written explicitly to avoid accidentally breaking the contract.

goversion

Source | Documentation | Stack: Go

🎲 Easily switch between multiple Go versions

I once needed to test a project with different Go versions to find a regression bug. Although Go supported installing multiple goX.Y binaries, the project had the go command hardcoded everywhere. The solution I came up with was to temporarily symlink go to goX.Y, which worked quite well. Based on this idea, I built goversion, a full-featured Go version manager. Unlike analogues, it's cross-platform and depends only on Go itself. Although Go 1.21 later introduced a similar feature, I still use goversion for explicit version management.

porkcron

Source | Stack: Python, Docker, systemd

🔏 Automatically renew SSL certificate for your Porkbun domain

As always, it started as a small script that quickly evolved to include configuration, installation helpers, and support for Docker and systemd. Now, it handles certificate renewals for all my websites.

Personal site

Link | Stack: Go, HTML, CSS

I've always liked coming across personal websites while browsing the web. Handcrafted pages feel cozy compared to corporate web. Unlike social media profiles, you own the entire website, not just the content. I'm not a fan of fancy frameworks and pre-built themes, so I built my personal site from scratch using vanilla HTML/CSS and some Go for static generation.