File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -578,25 +578,23 @@ func (p valuePath) Get(obj interface{}) interface{} {
578578 return nil
579579 }
580580
581- if slice , ok := obj .([]interface {}); ok && op .part == "[*]" {
582- // wildcard: garder tous les éléments
581+ if slice , ok := obj .([]interface {}); ok {
583582 var all []interface {}
584583 for _ , el := range slice {
584+ // non-wildcard: apply operation
585+ if op .part != "[*]" {
586+ el = op .op (el )
587+ }
588+
589+ // wildcard: keep all elements
585590 all = append (all , el )
586591 }
587592 obj = all
588593
589- } else if slice , ok := obj .([]interface {}); ok && op .part != "[*]" {
590- var all []interface {}
591- for _ , el := range slice {
592- all = append (all , op .op (el ))
593- }
594- obj = all
595594 } else {
596595 obj = op .op (obj )
597596 }
598597
599- //obj = op.op(obj)
600598 }
601599 return obj
602600}
You can’t perform that action at this time.
0 commit comments