set default value
This commit is contained in:
parent
bf5beb9d70
commit
22fcaa1b8b
@ -70,6 +70,7 @@ func (c *Config) DefineDefault(key string, val string, dtype DataType) {
|
||||
entry.dtype = dtype
|
||||
entry.unset = true
|
||||
entry.empty = false
|
||||
entry.value = val
|
||||
c.env[upper] = entry
|
||||
}
|
||||
}
|
||||
|
@ -7,7 +7,6 @@ import ("strconv"
|
||||
|
||||
func parseInt(key string, str string)(ret cValue) {
|
||||
val, err := strconv.ParseInt(str, 10, 64)
|
||||
fmt.Println(val)
|
||||
if err == nil {
|
||||
ret.intval = val
|
||||
} else {
|
||||
@ -18,7 +17,6 @@ func parseInt(key string, str string)(ret cValue) {
|
||||
|
||||
func parseDuration(key string, str string)(ret cValue) {
|
||||
val, err := time.ParseDuration(str)
|
||||
fmt.Println(val)
|
||||
if err == nil {
|
||||
ret.durval = val
|
||||
} else {
|
||||
@ -29,8 +27,6 @@ func parseDuration(key string, str string)(ret cValue) {
|
||||
|
||||
func parseBool(key string, str string)(ret cValue) {
|
||||
val, err := strconv.ParseBool(str)
|
||||
fmt.Printf("str = (%s)\n", str)
|
||||
fmt.Println(val)
|
||||
if err == nil {
|
||||
ret.boolval = val
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user