diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2021-06-16 05:57:09 -0400 |
---|---|---|
committer | Daniel J Walsh <dwalsh@redhat.com> | 2021-06-17 14:59:42 -0400 |
commit | b6662eed3f27ac5466501b046db4f1608845af61 (patch) | |
tree | 7a4f80a77f812505a6261bc11ed8151235f903f1 /vendor/github.com/imdario/mergo/merge.go | |
parent | 725b5001a17f703d95a3c88e4f58225c5290576b (diff) | |
download | podman-b6662eed3f27ac5466501b046db4f1608845af61.tar.gz podman-b6662eed3f27ac5466501b046db4f1608845af61.tar.bz2 podman-b6662eed3f27ac5466501b046db4f1608845af61.zip |
Vendor in containers/common v0.40.0
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'vendor/github.com/imdario/mergo/merge.go')
-rw-r--r-- | vendor/github.com/imdario/mergo/merge.go | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/vendor/github.com/imdario/mergo/merge.go b/vendor/github.com/imdario/mergo/merge.go index afa84a1e2..8c2a8fcd9 100644 --- a/vendor/github.com/imdario/mergo/merge.go +++ b/vendor/github.com/imdario/mergo/merge.go @@ -95,13 +95,18 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co } } } else { - if (isReflectNil(dst) || overwrite) && (!isEmptyValue(src) || overwriteWithEmptySrc) { + if dst.CanSet() && (isReflectNil(dst) || overwrite) && (!isEmptyValue(src) || overwriteWithEmptySrc) { dst.Set(src) } } case reflect.Map: if dst.IsNil() && !src.IsNil() { - dst.Set(reflect.MakeMap(dst.Type())) + if dst.CanSet() { + dst.Set(reflect.MakeMap(dst.Type())) + } else { + dst = src + return + } } if src.Kind() != reflect.Map { |