mirror of
https://github.com/mikefarah/yq.git
synced 2024-11-12 13:48:06 +00:00
13 lines
308 B
Go
13 lines
308 B
Go
package main
|
|
|
|
import "gopkg.in/imdario/mergo.v0"
|
|
|
|
func merge(dst interface{}, src interface{}, overwrite bool, append bool) error {
|
|
if overwrite {
|
|
return mergo.Merge(dst, src, mergo.WithOverride)
|
|
} else if append {
|
|
return mergo.Merge(dst, src, mergo.WithAppendSlice)
|
|
}
|
|
return mergo.Merge(dst, src)
|
|
}
|