A go package for parsing JSON config file.
- Parsing JSON config file.
- Config with default value.
$ go get github.com/monochromegane/go-config
This package uses struct for storing parsed JSON config data.
type Config struct {
Name string `json:"name" default:"default name"`
}
{
"name": "name"
}
And, you can get config by the following.
var conf Config
config.Parse("config.json", &conf)
- Show config description.
- Set default value to slice.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request