-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvalue_float64.gen.go
More file actions
51 lines (36 loc) · 1.77 KB
/
Copy pathvalue_float64.gen.go
File metadata and controls
51 lines (36 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package env
import "strconv"
type float64Value float64
func newFloat64Value(val float64, p *float64) *float64Value {
*p = val
return (*float64Value)(p)
}
func (f *float64Value) Set(val string) error {
v, err := strconv.ParseFloat(val, 64)
*f = float64Value(v)
return err
}
func (*float64Value) Type() string { return "float64" }
func (f *float64Value) String() string { return strconv.FormatFloat(float64(*f), 'g', -1, 64) }
// Float64Var defines a float64 environment variable with specified name, default value, and usage string.
// The argument p points to a float64 variable in which to store the value of the environment variable.
func (s *EnvVarSet) Float64Var(p *float64, name string, value float64, usage string) {
s.Var(newFloat64Value(value, p), name, usage)
}
// Float64 defines a float64 environment variable with specified name, default value, and usage string.
// The return value is the address of a float64 variable that stores the value of the environment variable.
func (s *EnvVarSet) Float64(name string, value float64, usage string) *float64 {
p := new(float64)
s.Float64Var(p, name, value, usage)
return p
}
// Float64Var defines a float64 environment variable with specified name, default value, and usage string.
// The argument p points to a float64 variable in which to store the value of the environment variable.
func Float64Var(p *float64, name string, value float64, usage string) {
Environment.Float64Var(p, name, value, usage)
}
// Float64 defines a float64 environment variable with specified name, default value, and usage string.
// The return value is the address of a float64 variable that stores the value of the environment variable.
func Float64(name string, value float64, usage string) *float64 {
return Environment.Float64(name, value, usage)
}