diff options
author | Ondřej Surý <ondrej@sury.org> | 2011-02-14 13:23:51 +0100 |
---|---|---|
committer | Ondřej Surý <ondrej@sury.org> | 2011-02-14 13:23:51 +0100 |
commit | 758ff64c69e34965f8af5b2d6ffd65e8d7ab2150 (patch) | |
tree | 6d6b34f8c678862fe9b56c945a7b63f68502c245 /src/pkg/flag/flag.go | |
parent | 3e45412327a2654a77944249962b3652e6142299 (diff) | |
download | golang-758ff64c69e34965f8af5b2d6ffd65e8d7ab2150.tar.gz |
Imported Upstream version 2011-02-01.1upstream/2011-02-01.1
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) { |