change logging
This commit is contained in:
parent
1e5a532bfd
commit
a17786e98c
|
@ -54,6 +54,7 @@ func setValue(obj any, key string, value any) error {
|
||||||
case map[string]any:
|
case map[string]any:
|
||||||
log.Println("Formerly", v[key])
|
log.Println("Formerly", v[key])
|
||||||
v[key] = value
|
v[key] = value
|
||||||
|
log.Println("Now", v[key])
|
||||||
case []any:
|
case []any:
|
||||||
idx, err := strconv.Atoi(key)
|
idx, err := strconv.Atoi(key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -61,7 +62,9 @@ func setValue(obj any, key string, value any) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
v = expand(v, idx)
|
v = expand(v, idx)
|
||||||
|
log.Println("Formerly", v[idx])
|
||||||
v[idx] = value
|
v[idx] = value
|
||||||
|
log.Println("Now", v[idx])
|
||||||
default:
|
default:
|
||||||
err = errors.New("couldn't determine type")
|
err = errors.New("couldn't determine type")
|
||||||
}
|
}
|
||||||
|
@ -101,7 +104,7 @@ func patch(obj any, path string, value any) error {
|
||||||
func (f *FeedResponse) Patch(instr *instruction) {
|
func (f *FeedResponse) Patch(instr *instruction) {
|
||||||
// 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, "to", instr.Value)
|
log.Println("updating", instr.Path)
|
||||||
err := patch(f, instr.Path, instr.Value)
|
err := patch(f, instr.Path, instr.Value)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Println(err)
|
log.Println(err)
|
||||||
|
|
Loading…
Reference in New Issue