You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using Go generics it's possible to greatly streamline the process of binding custom value types.
I have created a library as a POC github.com/mmatczuk/anyflag.
To work with it users have to provide the type and a parser (aka fromString) function.
Using Go generics it's possible to greatly streamline the process of binding custom value types.
I have created a library as a POC github.com/mmatczuk/anyflag.
To work with it users have to provide the type and a parser (aka fromString) function.
Example:
See full running example in example_test.go.
It's also possible to replace the concrete implementations here with the generic one largely reducing the code surface.
Please let me know what do you think.
The text was updated successfully, but these errors were encountered: