type storage … type localStorage … func (l localStorage) Store(data interface{ … } func (l localStorage) Load(data interface{ … } func timestamp(t time.Time) float64 { … } type state … // atomicWrite atomically writes data to a file specified by filename. func atomicWrite(filename string, data []byte, perm os.FileMode) error { … }