diff options
| author | Grégoire Duchêne <gduchene@awhk.org> | 2022-12-10 14:14:22 +0000 |
|---|---|---|
| committer | Grégoire Duchêne <gduchene@awhk.org> | 2022-12-10 14:22:57 +0000 |
| commit | 2df5e154434bce61c3e4aa9626b69f8ef5b80598 (patch) | |
| tree | 62809b60b1b529ef2f683ebfe9eb1df4c2a2d1c2 | |
| parent | 73519a3538720b2cbca59cde36f755a1e4068eae (diff) | |
Reorder things a bit
| -rw-r--r-- | flag.go | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -140,15 +140,15 @@ func (f *Feature) String() string { return fmt.Sprintf("%s (enabled: %t)", f.Name, f.Enabled()) } +// ParseFunc describes functions that will parse a string and return a +// value or an error. +type ParseFunc[T any] func(string) (T, error) + // ParseTime parses a string according to the time.RFC3339 format. func ParseTime(s string) (time.Time, error) { return time.Parse(time.RFC3339, s) } -// ParseFunc describes functions that will parse a string and return a -// value or an error. -type ParseFunc[T any] func(string) (T, error) - type flagFeature struct{ *Feature } func (flagFeature) IsBoolFlag() bool { return true } |
