vitessio/vitess

Rewrite `flagutil.OptionalFlag` to use generics

Closed

#11,154 opened on Sep 1, 2022

 (8 comments) (0 reactions) (1 assignee)Go (2,384 forks)batch import
Component: CLIType: Internal Cleanupgood first issue

Repository metrics

Stars
 (21,222 stars)
PR merge metrics
 (Avg merge 3d 21h) (134 merged PRs in 30d)

Description

Now that we have generics, we can stop hand-writing each implementation of flagutil.OptionalFlag for each type we want, instead writing a generic OptionalFlag over any type T, providing a parsing function that has the signature func(string) (T, error)

Contributor guide