I needed to store values in a key-value store that would persist after restarting the program. I’m not good at finding things on the internet until I know what exactly to search for.

So instead, I have written a simple package for storing my data session-like way.

https://github.com/shoobyban/simplesession is the result.

// Simple counter program using session storage
package main
import (
func main () {
    sess, err := simplesession.Load("sessionstore.data")
    if err == nil {
        z:= (*sess)["test"]
        if z != nil {
        } else {
            fmt.Println("Setting to 1, first run")
    } else {

I’m not saying it’s proper Go approach (I don’t really know what is proper yet) but does the job, simple to use and I have learnt a lot writing it.