From 2cdcbec36468aa0041ba6bfdaece521822a69f8a Mon Sep 17 00:00:00 2001 From: Roy Olav Purser Date: Sat, 29 Jan 2022 21:51:28 +0100 Subject: [PATCH] add test print --- envconf.go | 1 + tests/main.go | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/envconf.go b/envconf.go index 61ae76c..56c5023 100644 --- a/envconf.go +++ b/envconf.go @@ -55,6 +55,7 @@ func NewConfig() *Config { if len(config.mapEnv[left]) == 0 { config.mapEnv[left] = make(map[string]string) } + fmt.Printf("left=(%s), right=(%s), key=(%s)\n", left, right, key) config.mapEnv[left][right] = key } } diff --git a/tests/main.go b/tests/main.go index 76dcf92..cc7eb31 100644 --- a/tests/main.go +++ b/tests/main.go @@ -7,9 +7,13 @@ import ( func main() { conf := envconf.NewConfig() - conf.Define("this_is_a_map", envconf.FixedHex(22)) + conf.Define("this_is_a_map", envconf.TypeInt) + conf.Define("test_map", envconf.TypeInt) conf.Parse() conf.Status() + fmt.Println(conf) + + fmt.Println(conf.GetMapInt("test_map")) fmt.Println(conf.GetHex("this_is_a_map")) }