I just released persist, a small Go library for saving one typed value to disk, that's it. It can be used for a single string up to an entire struct. It uses JSON encoding and writes to user's config dir.
It's initialized generically with the type + an optional default value, then has two methods - Pull (which loads the saved value or returns a default on first run) and Push (which saves it in the user’s config directory using a temp file and rename).
It’s completely new, so no users yet. I’m curious whether this saves anyone enough boilerplate to use?
https://pkg.go.dev/github.com/clmncol/persist#example-packag...
Comments URL: https://news.ycombinator.com/item?id=50617685
Points: 1
# Comments: 0
