add test print

This commit is contained in:
Roy Olav Purser 2022-01-29 21:51:28 +01:00
parent f815bff582
commit 2cdcbec364
Signed by: roypur
GPG Key ID: E14D26A036F21656
2 changed files with 6 additions and 1 deletions

View File

@ -55,6 +55,7 @@ func NewConfig() *Config {
if len(config.mapEnv[left]) == 0 { if len(config.mapEnv[left]) == 0 {
config.mapEnv[left] = make(map[string]string) config.mapEnv[left] = make(map[string]string)
} }
fmt.Printf("left=(%s), right=(%s), key=(%s)\n", left, right, key)
config.mapEnv[left][right] = key config.mapEnv[left][right] = key
} }
} }

View File

@ -7,9 +7,13 @@ import (
func main() { func main() {
conf := envconf.NewConfig() 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.Parse()
conf.Status() conf.Status()
fmt.Println(conf)
fmt.Println(conf.GetMapInt("test_map"))
fmt.Println(conf.GetHex("this_is_a_map")) fmt.Println(conf.GetHex("this_is_a_map"))
} }