aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--duration.go7
-rw-r--r--flag.go7
2 files changed, 7 insertions, 7 deletions
diff --git a/duration.go b/duration.go
index db59463..db8bfd5 100644
--- a/duration.go
+++ b/duration.go
@@ -18,13 +18,6 @@ func (d *durationValue) Set(s string) error {
func (d *durationValue) String() string { return (*time.Duration)(d).String() }
-// Value is the interface to the dynamic value stored in a flag.
-// (The default value is represented as a string.)
-type Value interface {
- String() string
- Set(string) error
-}
-
// DurationVar defines a time.Duration flag with specified name, default value, and usage string.
// The argument p points to a time.Duration variable in which to store the value of the flag.
func (f *FlagSet) DurationVar(p *time.Duration, name string, value time.Duration, usage string) {
diff --git a/flag.go b/flag.go
index 9a16e7a..dfc03d2 100644
--- a/flag.go
+++ b/flag.go
@@ -149,6 +149,13 @@ type Flag struct {
Changed bool // If the user set the value (or if left to default)
}
+// Value is the interface to the dynamic value stored in a flag.
+// (The default value is represented as a string.)
+type Value interface {
+ String() string
+ Set(string) error
+}
+
// sortFlags returns the flags as a slice in lexicographical sorted order.
func sortFlags(flags map[string]*Flag) []*Flag {
list := make(sort.StringSlice, len(flags))