-
Notifications
You must be signed in to change notification settings - Fork 41
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
POC:
func main() {
type MyConfig struct {
Slice []struct {
A int
} `json:"slice" toml:"slice"`
}
var cfg MyConfig
loader := aconfig.LoaderFor(&cfg, aconfig.Config{
// feel free to skip some steps :)
// SkipDefaults: true,
// SkipFiles: true,
// SkipEnv: true,
// SkipFlags: true,
EnvPrefix: "APP",
FlagPrefix: "app",
Files: []string{"config.toml"},
FileDecoders: map[string]aconfig.FileDecoder{
// from `aconfigyaml` submodule
// see submodules in repo for more formats
".toml": aconfigtoml.New(),
},
})
if err := loader.Load(); err != nil {
panic(err)
}
fmt.Printf("%+v\n", cfg)
}
config.toml file:
[[slice]]
A = 5
Result:
panic: []map[string]interface {} [map[A:5]]
github.com/cristalhq/aconfig@v0.16.8/reflection.go:190
cristaloleg and simbafs
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working