Show HN: Persist – A simple Go configuration library

  • Posted 1 hour ago by clmncol
  • 1 points
https://github.com/clmncol/persist
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...

0 comments