Skip to content

Commit

Permalink
patch mv.PathsForKey
Browse files Browse the repository at this point in the history
  • Loading branch information
Charles Banning committed Feb 10, 2017
1 parent 9273f4d commit ace5d4f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions keyvalues.go
Expand Up @@ -595,13 +595,14 @@ func hasKeyPath(crumbs string, iv interface{}, key string, basket map[string]boo
case map[string]interface{}:
vv := iv.(map[string]interface{})
if _, ok := vv[key]; ok {
// create a new breadcrumb, intialized with the one we have
var nbc string
if crumbs == "" {
crumbs = key
nbc = key
} else {
crumbs += "." + key
nbc = crumbs + "." + key
}
// *basket = append(*basket, crumb)
basket[crumbs] = true
basket[nbc] = true
}
// walk on down the path, key could occur again at deeper node
for k, v := range vv {
Expand Down

0 comments on commit ace5d4f

Please sign in to comment.