2 Commits

Author SHA1 Message Date
2efc1a155e print mapEnv 2022-01-29 22:00:54 +01:00
45f8b0f918 add test print 2022-01-29 21:59:03 +01:00
2 changed files with 3 additions and 3 deletions

View File

@ -86,9 +86,11 @@ func (c *Config) Define(key string, dtype DataType) {
// Variables without a defined type will be ignored by Parse. // Variables without a defined type will be ignored by Parse.
func (c *Config) DefineMap(key string, dtype DataType) { func (c *Config) DefineMap(key string, dtype DataType) {
key = cleanKey(key) key = cleanKey(key)
fmt.Println(c.mapEnv)
entries, ok := c.mapEnv[key] entries, ok := c.mapEnv[key]
if ok { if ok {
for _, key = range entries { for _, key = range entries {
fmt.Printf("key-from-define-map (%s)\n", key)
entry := c.env[key] entry := c.env[key]
entry.dtype = dtype entry.dtype = dtype
c.env[key] = entry c.env[key] = entry

View File

@ -12,8 +12,6 @@ func main() {
conf.Parse() conf.Parse()
conf.Status() conf.Status()
fmt.Println(conf)
fmt.Println(conf.GetMapInt("test_map")) fmt.Println(conf.GetMapInt("test_map"))
fmt.Println(conf.GetHex("this_is_a_map")) fmt.Println(conf.GetInt("this_is_a_map"))
} }