Skip to content
Snippets Groups Projects
Commit ec63346c authored by Bolke de Bruin's avatar Bolke de Bruin
Browse files

Handle arrays in env variables

parent dc60652b
No related branches found
No related tags found
No related merge requests found
...@@ -164,7 +164,9 @@ func Load(configFile string) Configuration { ...@@ -164,7 +164,9 @@ func Load(configFile string) Configuration {
if err := k.Load(env.ProviderWithValue("RDPGW_", ".", func(s string, v string) (string, interface{}) { if err := k.Load(env.ProviderWithValue("RDPGW_", ".", func(s string, v string) (string, interface{}) {
key := strings.Replace(strings.ToLower(strings.TrimPrefix(s, "RDPGW_")), "__", ".", -1) key := strings.Replace(strings.ToLower(strings.TrimPrefix(s, "RDPGW_")), "__", ".", -1)
key = ToCamel(key) key = ToCamel(key)
return key, v
// handle the case where the value is a list
return key, strings.Split(strings.Trim(v, " "), " ")
}), nil); err != nil { }), nil); err != nil {
log.Fatalf("Error loading config from environment: %v", err) log.Fatalf("Error loading config from environment: %v", err)
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment