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

pflag option in ez package #36

Merged
merged 3 commits into from
Aug 7, 2020
Merged

pflag option in ez package #36

merged 3 commits into from
Aug 7, 2020

Conversation

sachinagada
Copy link
Contributor

Add a pflag specific option in the ez package. The implementation is general so we can substitute any sources for the flag package and add more source options in the future

ez/ez.go Outdated
Comment on lines 109 to 112
var flagSrc dials.Source
if option.flagSubstitute != nil {
flagSrc = option.flagSubstitute
} else {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's initialize flagSrc directly with option.flagSubstitute, the current else block just becomes if flagSrc == nil { ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh I like this a lot better. Thank you!

@sachinagada sachinagada merged commit 87e718a into master Aug 7, 2020
@sachinagada sachinagada deleted the Pflag-option branch August 7, 2020 17:27
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.

None yet

2 participants