set default value

This commit is contained in:
Roy Olav Purser 2021-03-24 16:16:34 +01:00
parent bf5beb9d70
commit 22fcaa1b8b
No known key found for this signature in database
GPG Key ID: 0BA77797F072BC52
2 changed files with 1 additions and 4 deletions

View File

@ -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
}
}

View File

@ -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 {