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
If I start my binary without arguments, c.StringSlice("filter") returns ["flag1", "flag2", "flag3"] as expected.
If I start my binary with --filter flag4, c.StringSlice("filter") returns ["flag1", "flag2", "flag3", "flag4"]. I find this behaviour odd, I expected it to erase the default value.
Even worst, if I start my binary with --filter flag1, c.StringSlice("filter") returns ["flag1", "flag2", "flag3", "flag1"].
Is this the expected behavior ? I know I have 3 default value so I can do c.StringSlice("filter")[3:] if set, but still it's not perfect.
Activity
jszwedko commentedon Jan 8, 2015
Mmm this definitely feels unexpected to me.
icexin commentedon Dec 10, 2015
EnvVar of StringSlice also has this behavior.
huguesalary commentedon Mar 8, 2016
I also have this issue and also feels this behavior is completely unexpected. Is there any plans on fixing this?
I'll see if I can take a stab at it and do a PR too.
jszwedko commentedon Mar 20, 2016
I'd be happy to review a PR for this @huguesalary !
jinhao commentedon Mar 23, 2016
I also hava this issue, expect to change this behavior.
Overwrite slice flag defaults when set
jszwedko commentedon May 21, 2016
Fixed by #392 (will be released is v2, but you can use that branch for now).