Skip to content

Conversation

@vgough
Copy link
Contributor

@vgough vgough commented Oct 13, 2025

Adds a Verify function on FlagSetFiller, which can be used to check that required fields were set after flags have been parsed.

Required flags are pretty common, so this reduces the amount of boilerplate

Copy link
Owner

@itzg itzg left a comment

Choose a reason for hiding this comment

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

Very cool! I had always wanted "required" support but always got stuck in the lack in base flags processing. Didn't dawn on me your novel idea of verifying separately.

Just a very minor change needed.

Thanks!

@vgough
Copy link
Contributor Author

vgough commented Oct 14, 2025

If you don't want the formatting and lint warning fixes (reflect.Ptr -> reflect.Pointer, interface{} -> any), then feel free to pull out the parts you want, I don't mind. I could have ignored the lint warnings, just seemed easy enough to fix them while I was poking around.

@itzg
Copy link
Owner

itzg commented Oct 14, 2025

If you don't want the formatting and lint warning fixes (reflect.Ptr -> reflect.Pointer, interface{} -> any), then feel free to pull out the parts you want, I don't mind. I could have ignored the lint warnings, just seemed easy enough to fix them while I was poking around.

Those changes are great. It's good to get the code more modernized.

@itzg itzg merged commit 18a76be into itzg:master Oct 14, 2025
1 check passed
@itzg
Copy link
Owner

itzg commented Oct 14, 2025

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