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
I have an issue with custom filter logic. I have written a filer below to uphold some custom logic required for that field, but i have noticed that it has no effect on the field, event tried returning straight -1 for all, with no luck.
v.AddFilter(
"tip_amount_filter", func(val interface{}) int64 {
if val != nil {
log.WithFields(log.Fields{"value": val}).Info("value should be other than nil")
return int64(val.(float64))
} else {
log.WithFields(log.Fields{"value": val}).Info("value should be nil")
return -1
}
},
)
v.FilterRule("tip_amount", "tip_amount_filter")
What am I doing wrong?
Thanks.
The text was updated successfully, but these errors were encountered:
Hello,
I have an issue with custom filter logic. I have written a filer below to uphold some custom logic required for that field, but i have noticed that it has no effect on the field, event tried returning straight -1 for all, with no luck.
What am I doing wrong?
Thanks.
The text was updated successfully, but these errors were encountered: