return error from patch method

This commit is contained in:
filifa committed 2024-07-13 18:34:30 -05:00
1 parent bf7b45bcc6
commit 20a0b66e5b
2 files changed
+6 -5

No files matched your search

+2 -4
View File
@@ -102,12 +102,10 @@ func patch(obj any, path string, value any) error {
return err
}
func (f *FeedResponse) Patch(instr *instruction) {
func (f *FeedResponse) Patch(instr *instruction) error {
// TODO: need to handle each type of instruction separately: add,
// replace, remove, copy, move
log.Println("updating", instr.Path)
err := patch(map[string]any(*f), instr.Path, instr.Value)
if err != nil {
log.Println(err)
}
return err
}