GetJSONPath is used for the #> and #>> operators.
(j json.JSON, ary DArray)
| 525 | |
| 526 | // GetJSONPath is used for the #> and #>> operators. |
| 527 | func GetJSONPath(j json.JSON, ary DArray) (json.JSON, error) { |
| 528 | // TODO(justin): this is slightly annoying because we have to allocate |
| 529 | // a new array since the JSON package isn't aware of DArray. |
| 530 | path := make([]string, len(ary.Array)) |
| 531 | for i, v := range ary.Array { |
| 532 | if v == DNull { |
| 533 | return nil, nil |
| 534 | } |
| 535 | path[i] = string(MustBeDString(v)) |
| 536 | } |
| 537 | return json.FetchPath(j, path) |
| 538 | } |
| 539 | |
| 540 | func addBinOp(symbol treebin.BinaryOperatorSymbol, ops ...*BinOp) { |
| 541 | s, ok := BinOps[symbol] |
nothing calls this directly
no test coverage detected
searching dependent graphs…