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

Only split when required

parent 7bf2a598
Branches
No related tags found
No related merge requests found
...@@ -165,10 +165,14 @@ func Load(configFile string) Configuration { ...@@ -165,10 +165,14 @@ func Load(configFile string) Configuration {
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)
newVal := strings.Split(strings.Trim(v, " "), " ") v = strings.Trim(v, " ")
log.Printf("Setting %s to %v", key, newVal)
// handle the case where the value is a list // handle lists
return key, newVal if strings.Contains(v, " ") {
return key, strings.Split(v, " ")
}
return key, 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