Closed lsytj0413 closed 1 year ago
Give this code:
expr, err := jp.ParseString("$.vals[-3:]") if err != nil { panic(err) } result := expr.Get(map[string]interface{}{ "vals": []int{0, 10, 20, 30, 40, 50}, }) fmt.Printf("result: %v\n", result)
the result is: [50 40 30],but it should be [30 40 50],evaluated at https://jsonpath.com/
[50 40 30]
[30 40 50]
version: v1.17.5
I'll get it fixed.
Did release v1.18.0 and later fix the issue?
No response, closing.
Sorry for the late reply. I have test it on v1.18.5,this have been fixed.
Give this code:
the result is:
[50 40 30]
,but it should be[30 40 50]
,evaluated at https://jsonpath.com/version: v1.17.5