Merge pull request #37567 from vdemeester/bump-mergo
Bump mergo to v0.3.6
This commit is contained in:
commit
9cf8feebbf
3 changed files with 9 additions and 2 deletions
|
@ -22,7 +22,7 @@ gotest.tools v2.1.0
|
|||
github.com/google/go-cmp v0.2.0
|
||||
|
||||
github.com/RackSec/srslog 456df3a81436d29ba874f3590eeeee25d666f8a5
|
||||
github.com/imdario/mergo v0.3.5
|
||||
github.com/imdario/mergo v0.3.6
|
||||
golang.org/x/sync fd80eb99c8f653c847d294a001bdf2a3a6f768f5
|
||||
|
||||
# buildkit
|
||||
|
|
2
vendor/github.com/imdario/mergo/README.md
generated
vendored
2
vendor/github.com/imdario/mergo/README.md
generated
vendored
|
@ -27,7 +27,7 @@ It is ready for production use. [It is used in several projects by Docker, Googl
|
|||
|
||||
### Latest release
|
||||
|
||||
[Release v0.3.4](https://github.com/imdario/mergo/releases/tag/v0.3.4).
|
||||
[Release v0.3.6](https://github.com/imdario/mergo/releases/tag/v0.3.6).
|
||||
|
||||
### Important note
|
||||
|
||||
|
|
7
vendor/github.com/imdario/mergo/merge.go
generated
vendored
7
vendor/github.com/imdario/mergo/merge.go
generated
vendored
|
@ -9,6 +9,7 @@
|
|||
package mergo
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
)
|
||||
|
||||
|
@ -127,6 +128,9 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co
|
|||
if !isEmptyValue(src) && (overwrite || isEmptyValue(dst)) && !config.AppendSlice {
|
||||
dstSlice = srcSlice
|
||||
} else if config.AppendSlice {
|
||||
if srcSlice.Type() != dstSlice.Type() {
|
||||
return fmt.Errorf("cannot append two slice with different type (%s, %s)", srcSlice.Type(), dstSlice.Type())
|
||||
}
|
||||
dstSlice = reflect.AppendSlice(dstSlice, srcSlice)
|
||||
}
|
||||
dst.SetMapIndex(key, dstSlice)
|
||||
|
@ -150,6 +154,9 @@ func deepMerge(dst, src reflect.Value, visited map[uintptr]*visit, depth int, co
|
|||
if !isEmptyValue(src) && (overwrite || isEmptyValue(dst)) && !config.AppendSlice {
|
||||
dst.Set(src)
|
||||
} else if config.AppendSlice {
|
||||
if src.Type() != dst.Type() {
|
||||
return fmt.Errorf("cannot append two slice with different type (%s, %s)", src.Type(), dst.Type())
|
||||
}
|
||||
dst.Set(reflect.AppendSlice(dst, src))
|
||||
}
|
||||
case reflect.Ptr:
|
||||
|
|
Loading…
Reference in a new issue