Open kamilsk opened 2 years ago
Motivation: extend flag types.
Draft
type Regexp regexp.Regexp func (reg *Regexp) Decode(value string) error { raw, err := regexp.Compile(fmt.Sprintf(`^%s$`, value)) if err != nil { return err } *reg = Regexp(*raw) return nil } func (reg *Regexp) Matcher() *regexp.Regexp { return (*regexp.Regexp)(reg) }
See https://github.com/kelseyhightower/envconfig#custom-decoders.
Motivation: extend flag types.
Draft
See https://github.com/kelseyhightower/envconfig#custom-decoders.