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
This isn't the only example; ValueGetter is used in other places as well.
We found that it doesn't work in nested maps, but it works in top-level maps.
Yes, valuegetter is not part of default expr default behaviour. I regret merging it actually. But why do you need those custom param containers in a first place?
I have defined a generic type for params, I wang use params.{key} nor params.{key}.Value() in expr.
type(
ParamValue struct {
typ ParamType
boolVal bool
intVal int
floatVal float64
stringVal string
arrayVal []*ParamValue
objectVal map[string]*ParamValue
}
)
func (v *ParamValue) Value() any {
switch v.typ {
case ParamTypeBool:
return v.boolVal
case ParamTypeInt:
return v.intVal
case ParamTypeFloat:
return v.floatVal
case ParamTypeString:
return v.stringVal
case ParamTypeArray:
return v.arrayVal
case ParamTypeObject:
return v.objectVal
default:
return nil
}
}
func (v ParamValue) AsAny() any {
return v.Value()
}
I'm truly sorry for the delay in replying to you.
For example, here I can use the more concise params.name1 and params.name1.name2 instead of params.name1.Value(), params.name1.Value().name2.Value().
Activity
antonmedv commentedon Dec 22, 2025
Why do you need to use a value getter?
veezhang commentedon Dec 23, 2025
I have defined a generic type for params, I wang use
params.{key}norparams.{key}.Value()in expr.veezhang commentedon Dec 23, 2025
This isn't the only example; ValueGetter is used in other places as well.
We found that it doesn't work in nested maps, but it works in top-level maps.
antonmedv commentedon Dec 25, 2025
Yes, valuegetter is not part of default expr default behaviour. I regret merging it actually. But why do you need those custom param containers in a first place?
veezhang commentedon Jan 8, 2026
I'm truly sorry for the delay in replying to you.
For example, here I can use the more concise
params.name1andparams.name1.name2instead ofparams.name1.Value(), params.name1.Value().name2.Value().antonmedv commentedon Jan 8, 2026
I see. I will try to look at this issue. But I think another aporoach could be taken.