Guest User

Untitled

a guest
Mar 19th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4. "log"
  5.  
  6. "github.com/k0kubun/pp"
  7. "github.com/podhmo/commithistory/config"
  8. )
  9.  
  10. // Config :
  11. type Config struct {
  12. Message string `json:"message"`
  13. }
  14.  
  15. func main() {
  16. c := config.New("foo")
  17. var conf Config
  18. if err := c.Load("config.json", &conf); err != nil {
  19. log.Fatal(err)
  20. }
  21.  
  22. pp.Println(conf)
  23.  
  24. conf.Message = "hello"
  25. c.Save("config.json", &conf)
  26. }
Add Comment
Please, Sign In to add comment