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
{{ message }}
Repository navigation
question about overload condition operator == #818
This seems to call the overloaded function for all == operators. Although this does not affect my business, I still wonder if there is a way to overload just for the json.Number type
By the way, I tried to use n.Left.Type().AssignableTo() like https://expr-lang.org/docs/patch#advanced-example mentioned but it seems doesn't work
Activity
seruman commentedon Aug 7, 2025
You need to have
statusin your environment to reference it in the expression;type FilterEnv struct { + Status json.Number `expr:"status"` JsonNumEq func(a json.Number, b any) bool }See; https://go.dev/play/p/gKd6LxdiVLN
Second example here with a struct environment might be useful; https://expr-lang.org/#examples
ForeverCzz commentedon Aug 8, 2025
I need to process dynamic fields by using map in project.
And because of that, Vistor-Patch seems more compatible to my code.
This seems to call the overloaded function for all == operators. Although this does not affect my business, I still wonder if there is a way to overload just for the json.Number type
By the way, I tried to use
n.Left.Type().AssignableTo()like https://expr-lang.org/docs/patch#advanced-example mentioned but it seems doesn't work