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.mapEnv[left][right] = key
|
||||
if count < len(splitted)-2 {
|
||||
if count < len(splitted)-1 {
|
||||
middle := splitted[count]
|
||||
right = strings.Join(splitted[count+1:], "_")
|
||||
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.mapMapEnv[left][middle][right] = key
|
||||
if count < len(splitted)-3 {
|
||||
if count < len(splitted)-2 {
|
||||
lmiddle := splitted[count]
|
||||
rmiddle := splitted[count+1]
|
||||
right = strings.Join(splitted[count+2:], "_")
|
||||
|
@ -11,7 +11,6 @@ func main() {
|
||||
conf.DefineMap("test_map", envconf.TypeInt)
|
||||
conf.Parse()
|
||||
conf.Status()
|
||||
fmt.Println(conf)
|
||||
fmt.Println(conf.GetMapInt("test_map"))
|
||||
fmt.Println(conf.GetMapMapInt("test_map"))
|
||||
fmt.Println(conf.GetInt("this_is_a_map"))
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user