yq/merge.go

13 lines
314 B
Go
Raw Normal View History

package main
2019-01-20 22:33:14 +00:00
import mergo "gopkg.in/imdario/mergo.v0"
2018-07-07 05:26:56 +00:00
func merge(dst interface{}, src interface{}, overwrite bool, append bool) error {
if overwrite {
2018-07-07 05:26:56 +00:00
return mergo.Merge(dst, src, mergo.WithOverride)
} else if append {
return mergo.Merge(dst, src, mergo.WithAppendSlice)
}
return mergo.Merge(dst, src)
}