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:
|
||||
log.Println("Formerly", v[key])
|
||||
v[key] = value
|
||||
log.Println("Now", v[key])
|
||||
case []any:
|
||||
idx, err := strconv.Atoi(key)
|
||||
if err != nil {
|
||||
|
@ -61,7 +62,9 @@ func setValue(obj any, key string, value any) error {
|
|||
}
|
||||
|
||||
v = expand(v, idx)
|
||||
log.Println("Formerly", v[idx])
|
||||
v[idx] = value
|
||||
log.Println("Now", v[idx])
|
||||
default:
|
||||
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) {
|
||||
// TODO: need to handle each type of instruction separately: add,
|
||||
// replace, remove, copy, move
|
||||
log.Println("updating", instr.Path, "to", instr.Value)
|
||||
log.Println("updating", instr.Path)
|
||||
err := patch(f, instr.Path, instr.Value)
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
|
|
Loading…
Reference in New Issue