updates to internal config module

This commit is contained in:
2023-03-11 11:19:53 -06:00
parent d029a6a0bf
commit 2d7593ddf9
5 changed files with 53 additions and 100 deletions

View File

@ -63,11 +63,13 @@ func getStructInfo(spec interface{}) ([]StructInfo, error) {
}
info.Key = strings.ToUpper(info.Key)
if ftype.Tag.Get("default") != "" {
v, err := typeConversion(ftype.Type.String(), ftype.Tag.Get("default"))
v, err := typeConversion(ftype.Type.String(), getOSEnv(ftype.Tag.Get("env"), ftype.Tag.Get("default")))
if err != nil {
return []StructInfo{}, err
}
info.DefaultValue = v
} else {
info.DefaultValue = getOSEnv(ftype.Tag.Get("env"), "")
}
infos = append(infos, info)
}