peterbourgon / ff

Flags-first package for configuration
Apache License 2.0
1.34k stars 59 forks source link

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

Open GeorgeMac opened 1 month ago

GeorgeMac commented 1 month ago

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.