the padded cell

#golang

20 August, 2025

gum simplifies making shell scripts interactive: no more wrestling with read commands and ANSI escape codes for user input: just proper text editing, defaults, and clean UI.

Their demo: gum gemo

For example, if you run:

gum input --width 50 --header "Favorite author?" \
 --value "Terry Pratchett"

It will give you a question with a sensible default that you can then change as you want, and what you wrote as you hit enter will be returned so your script can then use it.

If you instead has some options where you want to select one:

gum choose --header "Favorite book?" \
 "Hogfather" "Thief of Time" "The Night Watch" "Small Gods"

Which gives you a selection box, you can configure to allow multiple selections, and the one you pick is then returned.

And one I really love, have it show a spinner to indicate that yes… something is still going on:

gum spin --title="Counting down from 10" sleep 10

Built on bubbletea, a Go TUI framework, use that directly if you need these components in Go code rather than shell scripts.

til Singapore • #shell-scripting, #gum, #golang

07 July, 2025

Working with Go's test cache on CI

be fast by avoiding work, while doing the important work

I was trying to speed up our slow CI by caching Go builds. The easy win was caching Go’s module downloads (via GOPATH), but when I added GOCACHE for the build cache, I got a pleasant surprise: the tests were caching too. 🥳

I shared the change for review, and a colleague raised a great point: “What about our black box integration tests?” These tests hit APIs and external services that Go can’t track as dependencies. If they cache when they shouldn’t, we might miss real failures: the tests would pass because they didn’t re-run, not because the code actually works.

[… more]
blog Updated 7 min read Singapore • #how-to, #golang, #ci, #testing, #integration-testing