Skip to content

Commit 593149b

Browse files
committed
Fix examples
1 parent d0b8b4a commit 593149b

File tree

5 files changed

+8
-8
lines changed

5 files changed

+8
-8
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func main() {
3535
Age: 21,
3636
}
3737

38-
patch, _, _ := jsonpatch.CreateJSONPatch(updated, original)
38+
patch, _ := jsonpatch.CreateJSONPatch(updated, original)
3939
fmt.Println(patch.String())
4040
}
4141
```
@@ -75,7 +75,7 @@ func main() {
7575
{Position: "Senior Software Engineer", Company: "Github"},
7676
}
7777

78-
patch, _, _ := jsonpatch.CreateJSONPatch(updated, original, jsonpatch.WithPredicate(jsonpatch.Funcs{
78+
patch, _ := jsonpatch.CreateJSONPatch(updated, original, jsonpatch.WithPredicate(jsonpatch.Funcs{
7979
ReplaceFunc: func(pointer jsonpatch.JSONPointer, value, _ interface{}) bool {
8080
// only update volunteering jobs
8181
if job, ok := value.(Job); ok {
@@ -130,7 +130,7 @@ func main() {
130130
{Position: "Software Engineer", Company: "Github"},
131131
}
132132

133-
patch, _, _ := jsonpatch.CreateJSONPatch(updated, original.Jobs, jsonpatch.WithPrefix(jsonpatch.ParseJSONPointer("/jobs")))
133+
patch, _ := jsonpatch.CreateJSONPatch(updated, original.Jobs, jsonpatch.WithPrefix(jsonpatch.ParseJSONPointer("/jobs")))
134134
fmt.Println(patch.String())
135135
}
136136
```
@@ -188,7 +188,7 @@ func main() {
188188
},
189189
}
190190

191-
patch, _, _ := jsonpatch.CreateJSONPatch(updated, original,
191+
patch, _ := jsonpatch.CreateJSONPatch(updated, original,
192192
jsonpatch.IgnoreSliceOrderWithPattern([]jsonpatch.IgnorePattern{{Pattern: "/*", JSONField: "company"}}),
193193
jsonpatch.IgnoreSliceOrder(),
194194
)

examples/basic_example/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ func main() {
2121
Age: 21,
2222
}
2323

24-
patch, _, _ := jsonpatch.CreateJSONPatch(updated, original)
24+
patch, _ := jsonpatch.CreateJSONPatch(updated, original)
2525
fmt.Println(patch.String())
2626
}

examples/filter_patches_using_predicates/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func main() {
2222
{Position: "Senior Software Engineer", Company: "Github"},
2323
}
2424

25-
patch, _, _ := jsonpatch.CreateJSONPatch(updated, original, jsonpatch.WithPredicate(jsonpatch.Funcs{
25+
patch, _ := jsonpatch.CreateJSONPatch(updated, original, jsonpatch.WithPredicate(jsonpatch.Funcs{
2626
ReplaceFunc: func(pointer jsonpatch.JSONPointer, value, _ interface{}) bool {
2727
// only update volunteering jobs
2828
if job, ok := value.(Job); ok {

examples/ignore_slice_order/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ func main() {
3636
},
3737
}
3838

39-
patch, _, _ := jsonpatch.CreateJSONPatch(updated, original,
39+
patch, _ := jsonpatch.CreateJSONPatch(updated, original,
4040
jsonpatch.IgnoreSliceOrderWithPattern([]jsonpatch.IgnorePattern{{Pattern: "/*", JSONField: "company"}}),
4141
jsonpatch.IgnoreSliceOrder(),
4242
)

examples/partial_patches/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,6 @@ func main() {
2929
{Position: "Software Engineer", Company: "Github"},
3030
}
3131

32-
patch, _, _ := jsonpatch.CreateJSONPatch(updated, original.Jobs, jsonpatch.WithPrefix(jsonpatch.ParseJSONPointer("/jobs")))
32+
patch, _ := jsonpatch.CreateJSONPatch(updated, original.Jobs, jsonpatch.WithPrefix(jsonpatch.ParseJSONPointer("/jobs")))
3333
fmt.Println(patch.String())
3434
}

0 commit comments

Comments
 (0)