8000 GitHub - x-clone/jsonfile: Persist a Go object to a JSON file
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

x-clone/jsonfile

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

jsonfile:

Use jsonfile to persist a Go value to a JSON file.

type JSONFile
    func Load[Data any](path string) (*JSONFile[Data], error)
    func New[Data any](path string) (*JSONFile[Data], error)
    func (p *JSONFile[Data]) Read(fn func(data *Data))
    func (p *JSONFile[Data]) Write(fn func(*Data) error) error

There is a bit more thought put into the few lines of code in this repository than you might expect. If you want more details, see the blog post.

About

Persist a Go object to a JSON file

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%
0