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.
I noticed when I had a field which implemented
flag.Value
and I registered it usingAddStruct
that the default wasn't being respected. This adds support this by wrapping theflag.Value
in another implementation which tracks ifSet
is called and returns the default if not.