package jsonmerge

Import Path
	github.com/apapsch/go-jsonmerge/v2 (on go.dev)

Dependency Relation
	imports 6 packages, and imported by one package

Involved Source Files Package jsonmerge helps mergeing JSON objects For example you have this documents: original.json { "number": 1, "string": "value", "object": { "number": 1, "string": "value", "nested object": { "number": 2 }, "array": [1, 2, 3], "partial_array": [1, 2, 3] } } patch.json { "number": 2, "string": "value1", "nonexitent": "woot", "object": { "number": 3, "string": "value2", "nested object": { "number": 4 }, "array": [3, 2, 1], "partial_array": { "1": 4 } } } After merge you will have this result: { "number": 2, "string": "value1", "object": { "number": 3, "string": "value2", "nested object": { "number": 4 }, "array": [3, 2, 1], "partial_array": [1, 4, 3] } } merge.go
Package-Level Type Names (only one, which is exported)
/* sort exporteds by: | */
Merger describes result of merge operation and provides configuration. CopyNonexistent enables setting fields into the result which only exist in the patch. Errors is slice of non-critical errors of merge operations Replaced is describe replacements Key is path in document like "prop1.prop2.prop3" for object properties or "arr1.1.prop" for arrays Value is value of replacemet Merge merges patch document to data document Returning merged document. Result of merge operation can be obtained from the Merger. Result information is discarded before merging. MergeBytes merges patch document buffer to data document buffer Returning merged document buffer, merge info and error if any MergeBytesIndent merges patch document buffer to data document buffer Use prefix and indent for set indentation like in json.MarshalIndent Returning merged document buffer and error if any.
Package-Level Functions (only one, which is unexported)