-
Notifications
You must be signed in to change notification settings - Fork 0
/
value_int64.gen.go
51 lines (36 loc) · 1.69 KB
/
value_int64.gen.go
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 int64Value int64
func newInt64Value(val int64, p *int64) *int64Value {
*p = val
return (*int64Value)(p)
}
func (i *int64Value) Set(val string) error {
v, err := strconv.ParseInt(val, 0, 64)
*i = int64Value(v)
return err
}
func (*int64Value) Type() string { return "int64" }
func (i *int64Value) String() string { return strconv.FormatInt(int64(*i), 10) }
// Int64Var defines an int64 environment variable with specified name, default value, and usage string.
// The argument p points to an int64 variable in which to store the value of the environment variable.
func (s *EnvVarSet) Int64Var(p *int64, name string, value int64, usage string) {
s.Var(newInt64Value(value, p), name, usage)
}
// Int64 defines an int64 environment variable with specified name, default value, and usage string.
// The return value is the address of an int64 variable that stores the value of the environment variable.
func (s *EnvVarSet) Int64(name string, value int64, usage string) *int64 {
p := new(int64)
s.Int64Var(p, name, value, usage)
return p
}
// Int64Var defines an int64 environment variable with specified name, default value, and usage string.
// The argument p points to an int64 variable in which to store the value of the environment variable.
func Int64Var(p *int64, name string, value int64, usage string) {
Environment.Int64Var(p, name, value, usage)
}
// Int64 defines an int64 environment variable with specified name, default value, and usage string.
// The return value is the address of an int64 variable that stores the value of the environment variable.
func Int64(name string, value int64, usage string) *int64 {
return Environment.Int64(name, value, usage)
}