Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@vipally
Copy link
Contributor

@vipally vipally commented Feb 5, 2021

What type of PR is this?

(REQUIRED)

  • bug
  • cleanup
  • documentation
  • feature

What this PR does / why we need it:

As issue #1235 describes, this bug make the help info confuse, this PR fix this bug.
The SliceFlag hold on a pointer of a struct, when flagSet parse it, the DefaultValue changes,
so pass SliceFlag by a copy-value to flagSet for parse.

Which issue(s) this PR fixes:

Fixes #1235

Testing

A new test case TestFlagDefaultValue was added to flag_test.go

Release Notes

bug fix #1235 : default value changes with parsed values on slice flags

@vipally vipally requested a review from a team as a code owner February 5, 2021 07:46
@vipally vipally requested review from coilysiren and saschagrunert and removed request for a team February 5, 2021 07:46
dearchap
dearchap previously approved these changes Mar 28, 2021
@coilysiren coilysiren requested review from a team and removed request for coilysiren and saschagrunert April 23, 2021 19:44
rliebz
rliebz previously approved these changes Apr 24, 2021
@rliebz rliebz dismissed stale reviews from dearchap and themself via df67478 April 24, 2021 16:51
@rliebz rliebz force-pushed the ally_fix_default_val branch from df67478 to ab52d6f Compare April 24, 2021 16:59
@rliebz rliebz merged commit 75602a4 into urfave:master Apr 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

v2 bug: default value changes with parsed values on slice flags

3 participants