Skip to content

Commit

Permalink
SetValuesFromKV: key skip empty section
Browse files Browse the repository at this point in the history
  • Loading branch information
chai2010 committed Apr 19, 2018
1 parent 4eff9d3 commit ab63064
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion jsonmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,12 @@ func (m JsonMap) SetValuesFromKV(values map[string]interface{}, keySep string) {
}

for k, v := range values {
key := strings.Split(k, keySep)
var key []string
for _, v := range strings.Split(k, keySep) {
if v != "" {
key = append(key, v) // skip empty section
}
}
m.SetValue(v, key[0], key[1:]...)
}
return
Expand Down

0 comments on commit ab63064

Please sign in to comment.