aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrégoire Duchêne <gduchene@awhk.org>2022-12-10 14:14:22 +0000
committerGrégoire Duchêne <gduchene@awhk.org>2022-12-10 14:22:57 +0000
commit2df5e154434bce61c3e4aa9626b69f8ef5b80598 (patch)
tree62809b60b1b529ef2f683ebfe9eb1df4c2a2d1c2
parent73519a3538720b2cbca59cde36f755a1e4068eae (diff)
Reorder things a bit
-rw-r--r--flag.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/flag.go b/flag.go
index fd60893..51c78aa 100644
--- a/flag.go
+++ b/flag.go
@@ -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 }