Skip to content

Commit

Permalink
fix: --state-values-set not setting more than first child in nested p…
Browse files Browse the repository at this point in the history
…aths

Fixes #773
  • Loading branch information
mumoshu committed Jul 27, 2019
1 parent b2a6231 commit 308efc6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pkg/maputil/maputil.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,13 @@ func Set(m map[string]interface{}, key []string, value string) map[string]interf

nested, ok := m[k]
if !ok {
new_m := map[string]interface{}{}
nested = Set(new_m, remain, value)
nested = map[string]interface{}{}
}
switch t := nested.(type) {
case map[string]interface{}:
nested = Set(t, remain, value)
default:
panic(fmt.Errorf("unexpected type: %v(%T)", t, t))
}

m[k] = nested
Expand Down

0 comments on commit 308efc6

Please sign in to comment.