From 22fcaa1b8b9c834741e989ffa13b9cfb247556ab Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Wed, 24 Mar 2021 16:16:34 +0100 Subject: [PATCH] set default value --- envconf.go | 1 + parsers.go | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/envconf.go b/envconf.go index ced8c2d..b5c30e4 100644 --- a/envconf.go +++ b/envconf.go @@ -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 } } diff --git a/parsers.go b/parsers.go index 292ad03..2bb6488 100644 --- a/parsers.go +++ b/parsers.go @@ -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 {