sip fills a Go struct with data from any sources.
Warning
This project is currently under development and not stable.
type MyConfig struct {
Profile string `sip:"profile"`
User *MyUserConfig `sip:"user"`
}
type MyUserConfig struct {
Username string `sip:"username"`
Password string `sip:"password"`
}
func main() {
config := &MyConfig{}
prefix := "my"
sip.RegisterFile("examples/my.json")
if err := sip.Fill(config, prefix); err != nil {
panic(err)
}
}