return error from patch method
This commit is contained in:
parent
bf7b45bcc6
commit
20a0b66e5b
|
@ -102,12 +102,10 @@ func patch(obj any, path string, value any) error {
|
||||||
return err
|
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,
|
// TODO: need to handle each type of instruction separately: add,
|
||||||
// replace, remove, copy, move
|
// replace, remove, copy, move
|
||||||
log.Println("updating", instr.Path)
|
log.Println("updating", instr.Path)
|
||||||
err := patch(map[string]any(*f), instr.Path, instr.Value)
|
err := patch(map[string]any(*f), instr.Path, instr.Value)
|
||||||
if err != nil {
|
return err
|
||||||
log.Println(err)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue