Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 2 commits into from Apr 24, 2021

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 saschagrunert and coilysiren 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 saschagrunert and coilysiren 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 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