Although came across this when using viper, I believe this is a mapstructure issue
I am defining a slice flag as follows
fs.StringArray(name, sliceValue, help)
where sliceValue: = []string{"PUT", "POST"}
The corresponding Config struct field is the following
CORSAllowMethods []string `mapstructure:"CORS_ALLOW_METHODS" name:"cors-allow-methods" long:"cors-allow-methods" defaultValue:"PUT POST" help:"List of CORS methods that are allowed"`
After performing a v.Unmarshal(&conf) was expecting something like this:
Although came across this when using viper, I believe this is a
mapstructure
issueI am defining a slice flag as follows
where
sliceValue: = []string{"PUT", "POST"}
The corresponding
Config
struct field is the followingAfter performing a
v.Unmarshal(&conf)
was expecting something like this:The end result after
v.Unmarshal(&conf)
is(a nested slice???!!!)