diff options
Diffstat (limited to 'src/pkg/flag/flag.go')
-rw-r--r-- | src/pkg/flag/flag.go | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/pkg/flag/flag.go b/src/pkg/flag/flag.go index 04fe2fa05..143a10611 100644 --- a/src/pkg/flag/flag.go +++ b/src/pkg/flag/flag.go @@ -166,22 +166,6 @@ func (s *stringValue) Set(val string) bool { func (s *stringValue) String() string { return fmt.Sprintf("%s", *s) } -// -- Float Value -type floatValue float - -func newFloatValue(val float, p *float) *floatValue { - *p = val - return (*floatValue)(p) -} - -func (f *floatValue) Set(s string) bool { - v, err := strconv.Atof(s) - *f = floatValue(v) - return err == nil -} - -func (f *floatValue) String() string { return fmt.Sprintf("%v", *f) } - // -- Float64 Value type float64Value float64 @@ -385,20 +369,6 @@ func String(name, value string, usage string) *string { return p } -// FloatVar defines a float flag with specified name, default value, and usage string. -// The argument p points to a float variable in which to store the value of the flag. -func FloatVar(p *float, name string, value float, usage string) { - Var(newFloatValue(value, p), name, usage) -} - -// Float defines a float flag with specified name, default value, and usage string. -// The return value is the address of a float variable that stores the value of the flag. -func Float(name string, value float, usage string) *float { - p := new(float) - FloatVar(p, name, value, usage) - return p -} - // Float64Var defines a float64 flag with specified name, default value, and usage string. // The argument p points to a float64 variable in which to store the value of the flag. func Float64Var(p *float64, name string, value float64, usage string) { |