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
|
||||
}
|
||||
|
||||
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
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue