forked from mirror/viper
Fixed TestBindPFlagsStringSlice()
Replaced Visit() by VisitAll(), so that the Changed attribute of the updated flag is correctly set.
This commit is contained in:
parent
cc7e906d88
commit
69647fb422
|
@ -630,11 +630,9 @@ func TestBindPFlagsStringSlice(t *testing.T) {
|
|||
|
||||
flagSet := pflag.NewFlagSet("test", pflag.ContinueOnError)
|
||||
flagSet.StringSlice("stringslice", testValue.Expected, "test")
|
||||
flagSet.Visit(func(f *pflag.Flag) {
|
||||
if len(testValue.Value) > 0 {
|
||||
flagSet.VisitAll(func(f *pflag.Flag) {
|
||||
f.Value.Set(testValue.Value)
|
||||
f.Changed = changed
|
||||
}
|
||||
})
|
||||
|
||||
err := v.BindPFlags(flagSet)
|
||||
|
|
Loading…
Reference in New Issue