Skip to content

Conversation

@dlo9
Copy link
Contributor

@dlo9 dlo9 commented Jun 12, 2025

When using pflag, which is required with viper or cobra, flag types show up like this, which looks very odd:

      --count simpleType[int16]             
      --enabled                 
      --hosts strSliceVar         
      --map strToStrMapVar 
      --timeout duration         (default 0s)

This PR implements Type() string for all custom types so that they show up as normal go types rather than flagfiller's wrapper types, which is used by pflag to resolve the type name

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 nice! Happy to see even more cross integration being possible.

@itzg itzg merged commit 786c076 into itzg:master Jun 12, 2025
1 check passed
@itzg
Copy link
Owner

itzg commented Jun 12, 2025

Included in https://github.com/itzg/go-flagsfiller/releases/tag/v1.15.2

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