MCPcopy
hub / github.com/darccio/mergo / Merge

Function Merge

merge.go:318–320  ·  view source on GitHub ↗

Merge will fill any empty for value type attributes on the dst struct using corresponding src attributes if they themselves are not empty. dst and src must be valid same-type structs and dst must be a pointer to struct. It won't merge unexported (private) fields and will do recursively any exported

(dst, src interface{}, opts ...func(*Config))

Source from the content-addressed store, hash-verified

316// and dst must be a pointer to struct.
317// It won't merge unexported (private) fields and will do recursively any exported field.
318func Merge(dst, src interface{}, opts ...func(*Config)) error {
319 return merge(dst, src, opts...)
320}
321
322// MergeWithOverwrite will do the same as Merge except that non-empty dst attributes will be overridden by
323// non-empty src attribute values.

Callers 15

TestIssue149Function · 0.92
TestMergeEmbeddedFunction · 0.92
TestV039Issue146Function · 0.92
TestIssue129BooleanFunction · 0.92
TestIssue202Function · 0.92
TestIssue90Function · 0.92
TestIssue209Function · 0.92
TestPrivateSliceFunction · 0.92

Calls 1

mergeFunction · 0.85

Tested by 15

TestIssue149Function · 0.74
TestMergeEmbeddedFunction · 0.74
TestV039Issue146Function · 0.74
TestIssue129BooleanFunction · 0.74
TestIssue202Function · 0.74
TestIssue90Function · 0.74
TestIssue209Function · 0.74
TestPrivateSliceFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…