Dear all,
I try to read a config yaml into a struct...
I verified that the path is correct and the struct matches the file content.
After the reading step, I don't receive any error.... unfortunately the variable is complete empty...
e.g.
type ConfigYAML struct {
Configuration struct {
id string `yaml:"id" env:"ID" env-description:"Config ID"`
name string `yaml:"name" env:"NAME" env-description:"Config Name"`
description string `yaml:"description" env:"DESC" env-description:"Config ID"`
asynchronous bool `yaml:"async" env:"ASYNC" env-description:"Config Async flag"`
active bool `yaml:"active" env:"ACTIVE" env-description:"Config Active flag"`
commands []string `yaml:"commands" env:"COMMANDS" env-description:"Config Commands"`
} `yaml:"configuration"`
}
...
var newconfyaml ConfigYAML
newpath := filepath.Join(strPath, f.Name())
if err = cleanenv.ReadConfig(newpath, &newconfyaml); err != nil {
fmt.Println(err)
os.Exit(2)
}
Dear all, I try to read a config yaml into a struct... I verified that the path is correct and the struct matches the file content. After the reading step, I don't receive any error.... unfortunately the variable is complete empty...
e.g.
The path points to the existing yaml
Here the content
Do you have any clue what's going on?