summaryrefslogtreecommitdiff
path: root/vendor/github.com/imdario/mergo/map.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-07-31 09:27:21 +0200
committerValentin Rothberg <rothberg@redhat.com>2020-09-08 08:47:19 +0200
commit7fea46752cbfb0ef7bfdd694afe95038c9875212 (patch)
treecabd8c0ea232c36cfff7511cb1b1f3bfa30c0bbf /vendor/github.com/imdario/mergo/map.go
parentbe7778df6c70227dab760ea92637ed97dad29641 (diff)
downloadpodman-7fea46752cbfb0ef7bfdd694afe95038c9875212.tar.gz
podman-7fea46752cbfb0ef7bfdd694afe95038c9875212.tar.bz2
podman-7fea46752cbfb0ef7bfdd694afe95038c9875212.zip
support multi-image (docker) archives
Support loading and saving tarballs with more than one image. Add a new `/libpod/images/export` endpoint to the rest API to allow for exporting/saving multiple images into an archive. Note that a non-release version of containers/image is vendored. A release version must be vendored before cutting a new Podman release. We force the containers/image version via a replace in the go.mod file; this way go won't try to match the versions. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor/github.com/imdario/mergo/map.go')
-rw-r--r--vendor/github.com/imdario/mergo/map.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/vendor/github.com/imdario/mergo/map.go b/vendor/github.com/imdario/mergo/map.go
index d83258b4d..a13a7ee46 100644
--- a/vendor/github.com/imdario/mergo/map.go
+++ b/vendor/github.com/imdario/mergo/map.go
@@ -99,11 +99,11 @@ func deepMap(dst, src reflect.Value, visited map[uintptr]*visit, depth int, conf
continue
}
if srcKind == dstKind {
- if _, err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil {
+ if err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil {
return
}
} else if dstKind == reflect.Interface && dstElement.Kind() == reflect.Interface {
- if _, err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil {
+ if err = deepMerge(dstElement, srcElement, visited, depth+1, config); err != nil {
return
}
} else if srcKind == reflect.Map {
@@ -141,6 +141,9 @@ func MapWithOverwrite(dst, src interface{}, opts ...func(*Config)) error {
}
func _map(dst, src interface{}, opts ...func(*Config)) error {
+ if dst != nil && reflect.ValueOf(dst).Kind() != reflect.Ptr {
+ return ErrNonPointerAgument
+ }
var (
vDst, vSrc reflect.Value
err error
@@ -157,8 +160,7 @@ func _map(dst, src interface{}, opts ...func(*Config)) error {
// To be friction-less, we redirect equal-type arguments
// to deepMerge. Only because arguments can be anything.
if vSrc.Kind() == vDst.Kind() {
- _, err := deepMerge(vDst, vSrc, make(map[uintptr]*visit), 0, config)
- return err
+ return deepMerge(vDst, vSrc, make(map[uintptr]*visit), 0, config)
}
switch vSrc.Kind() {
case reflect.Struct: