A reflection on filters #65
remyduthu
started this conversation in
Show and tell
Replies: 1 comment
-
Hi @remyduthu. Thanks for posting. I tend to be hesitant to use reflection in Go most of the type. I find it's easier to introduce bugs personally. It's a cool implementation though. :) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi Ben, first of all thank you for your articles which helped me a lot to structure my Go projects! I'd like to share a function that uses the
reflect
package to construct aWHERE
clause from a filter structure. Here is the function:And, here is an example of a filter:
The function will dynamically build the clause using the
Name
andEmail
fields.Beta Was this translation helpful? Give feedback.
All reactions