diff --git a/viper_test.go b/viper_test.go index d5c637d..21b49c9 100644 --- a/viper_test.go +++ b/viper_test.go @@ -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 { - f.Value.Set(testValue.Value) - f.Changed = changed - } + flagSet.VisitAll(func(f *pflag.Flag) { + f.Value.Set(testValue.Value) + f.Changed = changed }) err := v.BindPFlags(flagSet)