Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pluralsh/polly
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.1.4
Choose a base ref
...
head repository: pluralsh/polly
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.1.5
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on Mar 5, 2024

  1. Copy the full SHA
    7efbdc5 View commit details
Showing with 22 additions and 0 deletions.
  1. +22 −0 algorithms/map.go
22 changes: 22 additions & 0 deletions algorithms/map.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package algorithms

func Merge(m1, m2 map[string]interface{}) map[string]interface{} {
// lifted from helm's merge code
out := make(map[string]interface{}, len(m1))
for k, v := range m1 {
out[k] = v
}

for k, v := range m2 {
if v, ok := v.(map[string]interface{}); ok {
if bv, ok := out[k]; ok {
if bv, ok := bv.(map[string]interface{}); ok {
out[k] = Merge(bv, v)
continue
}
}
}
out[k] = v
}
return out
}