You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.
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:
CORSAllowMethods:[PUT POST]
The end result after v.Unmarshal(&conf) is
CORSAllowMethods:[[PUT POST]]
(a nested slice???!!!)
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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???!!!)
The text was updated successfully, but these errors were encountered: