A simple configuration with Toml File. supports default tag.
go get github.com/Yprolic/TomlConfiguration
Lets define and struct that defines our configuration
type Server struct {
Name string
Port int `default:"6060"`
Enabled bool
Users []string
}
Load the configuration into multiconfig:
m := TOMLLoader{Path: "conf/conf.toml"}
serverConf := &Server{}
err := m.Load(s)
serverConf.Port // by default 6060
serverConf.Name // "prolic"
The MIT License (MIT) - see LICENSE for more details