Skip to content

Support default for flag.Value implementations registered via AddStruct#136

Closed
GeorgeMac wants to merge 1 commit into
peterbourgon:mainfrom
GeorgeMac:gm/default-on-value-impl
Closed

Support default for flag.Value implementations registered via AddStruct#136
GeorgeMac wants to merge 1 commit into
peterbourgon:mainfrom
GeorgeMac:gm/default-on-value-impl

Conversation

@GeorgeMac

Copy link
Copy Markdown
Contributor

I noticed when I had a field which implemented flag.Value and I registered it using AddStruct that the default wasn't being respected. This adds support this by wrapping the flag.Value in another implementation which tracks if Set is called and returns the default if not.

@peterbourgon

Copy link
Copy Markdown
Owner

PTAL at #143

@peterbourgon

Copy link
Copy Markdown
Owner

Should be fixed by #148

@GeorgeMac

Copy link
Copy Markdown
Contributor Author

Thank you!

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.

2 participants