fix: read env config
This commit is contained in:
parent
5d7f558ed4
commit
d500ca7576
@ -7,6 +7,7 @@ import (
|
||||
"os/exec"
|
||||
"reflect"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@ -119,6 +120,11 @@ func loadEnvVariables(cfg interface{}) {
|
||||
if value, err := strconv.ParseBool(envValue); err == nil {
|
||||
v.Field(i).SetBool(value)
|
||||
}
|
||||
case reflect.Slice:
|
||||
if field.Type.Elem().Kind() == reflect.String {
|
||||
envValueSlice := strings.Split(envValue, ",")
|
||||
v.Field(i).Set(reflect.ValueOf(envValueSlice))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user