Skip to content
/ persist Public
forked from matryer/persist

Persist loads and saves Go objects to files

License

Notifications You must be signed in to change notification settings

keks/persist

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

persist GoDoc

Persist loads and saves Go objects to files

Usage

First get it:

go get github.com/keks/persist

Then save objects like this:

var conf Config
f, err := os.Create("./project.conf")
if err != nil {
	log.Faralln("failed opening the persistent file:", err)
}

if err = persist.Save(f, &conf); err != nil {
	log.Fatalln("failed to save config:", err)
}

And load them like this:

// f is still in scope

var conf Config
if err := persist.Load(f, &conf); err != nil {
	log.Fatalln("failed to load config:", err)
}

About

Persist loads and saves Go objects to files

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%