change map offset
This commit is contained in:
parent
4520530b7f
commit
3c23ee5473
@ -62,7 +62,7 @@ func NewConfig() *Config {
|
|||||||
config.mapMapMapEnv[left] = make(map[string]map[string]map[string]string)
|
config.mapMapMapEnv[left] = make(map[string]map[string]map[string]string)
|
||||||
}
|
}
|
||||||
config.mapEnv[left][right] = key
|
config.mapEnv[left][right] = key
|
||||||
if count < len(splitted)-2 {
|
if count < len(splitted)-1 {
|
||||||
middle := splitted[count]
|
middle := splitted[count]
|
||||||
right = strings.Join(splitted[count+1:], "_")
|
right = strings.Join(splitted[count+1:], "_")
|
||||||
if len(config.mapMapEnv[left][middle]) == 0 {
|
if len(config.mapMapEnv[left][middle]) == 0 {
|
||||||
@ -70,7 +70,7 @@ func NewConfig() *Config {
|
|||||||
config.mapMapMapEnv[left][middle] = make(map[string]map[string]string)
|
config.mapMapMapEnv[left][middle] = make(map[string]map[string]string)
|
||||||
}
|
}
|
||||||
config.mapMapEnv[left][middle][right] = key
|
config.mapMapEnv[left][middle][right] = key
|
||||||
if count < len(splitted)-3 {
|
if count < len(splitted)-2 {
|
||||||
lmiddle := splitted[count]
|
lmiddle := splitted[count]
|
||||||
rmiddle := splitted[count+1]
|
rmiddle := splitted[count+1]
|
||||||
right = strings.Join(splitted[count+2:], "_")
|
right = strings.Join(splitted[count+2:], "_")
|
||||||
|
@ -11,7 +11,6 @@ func main() {
|
|||||||
conf.DefineMap("test_map", envconf.TypeInt)
|
conf.DefineMap("test_map", envconf.TypeInt)
|
||||||
conf.Parse()
|
conf.Parse()
|
||||||
conf.Status()
|
conf.Status()
|
||||||
fmt.Println(conf)
|
fmt.Println(conf.GetMapMapInt("test_map"))
|
||||||
fmt.Println(conf.GetMapInt("test_map"))
|
|
||||||
fmt.Println(conf.GetInt("this_is_a_map"))
|
fmt.Println(conf.GetInt("this_is_a_map"))
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user