I would like to verify the users' input before inserting it into the database. With this trim function, I can check whether the input was empty was empty or not.
if len(strings.Trim(r.Form.Get("firstName"), " ")) == 0 {
But I would like also to detect messages like these:
"username": {"$ne": null}
I tried stuff like if len(strings.Trim(r.Form.Get("firstName"), " $/^\")) == 0 {
, but always get errors concerning the signs. What am I doing wrong?