Skip to content

jamiecuthill/patchway

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Patchway

A JSON Patch library that makes it easy to construct patch operations by hand.

Get It!

go get -u github.com/jamiecuthill/patchway@main

Example Usage

ops := patchway.Operations{
    patchway.Replace(first_name, "name", "first"),
    patchway.Replace(last_name, "name", "last"),
}

Use in conjunction with a JSON Patch SDK as follows

patch, err := jsonpatch.DecodePatch(ops.Bytes())
if err != nil {
    panic(err)
}

modified, err := patch.Apply(original)
if err != nil {
    panic(err)
}

About

Golang library for manually constructing jsonpatch operations

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages