![]() godep restore pushd $GOPATH/src/github.com/appc/spec git co master popd go get go4.org/errorutil rm -rf Godeps godep save ./... git add vendor git add -f $(git ls-files --other vendor/) git co -- Godeps/LICENSES Godeps/.license_file_state Godeps/OWNERS |
||
---|---|---|
.. | ||
.travis.yml | ||
LICENSE | ||
merge.go | ||
patch.go | ||
README.md |
JSON-Patch
Provides the abiilty to modify and test a JSON according to a RFC6902 JSON patch and RFC7386 JSON Merge Patch.
Version: 1.0
API Usage
-
Given a
[]byte
, obtain a Patch objectobj, err := jsonpatch.DecodePatch(patch)
-
Apply the patch and get a new document back
out, err := obj.Apply(doc)
-
Create a JSON Merge Patch document based on two json documents (a to b):
mergeDoc, err := jsonpatch.CreateMergePatch(a, b)
-
Bonus API: compare documents for structural equality
jsonpatch.Equal(doca, docb)