You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The JSONPath standard supports single-quotes for bracket notation (see here) but they fail with a syntax error:
m:=map[string]interface{}{
"field": map[string]interface{}{
"sub-field": "hello",
},
}
value, err:=jsonpath.Get("$.field['sub-field']", m)
// err is incorrectly set to `could not parse string: invalid syntax`// the following case works correctly:value, err:=jsonpath.Get("$.field[\"sub-field\"]", m)
// err is nil, value is "hello"
The JSONPath standard supports single-quotes for bracket notation (see here) but they fail with a syntax error:
Instead I'd expect this to work correctly.