Closed mrbardia72 closed 2 months ago
When you have these questions start with the "purpose" of the code. Without understanding the purpose, it's hard to answer.
Was this a mistake? I don't understand.
Oh, sorry, there was a mistake
Actually, I know how this code should be written I just wanted to ask if the place where I should check regex is this part or not
I can't give you guidance on where to put it if I don't know the purpose of the code as it relates to the project. Saying you have a regex without telling me what and why you have this leaves blind
For example, I want to check the user name (check means the regex) which has a special regex I want to check the correctness of the username entered by the user
Then you would want a Name type in the user package that would be the type for the name field in the user model. That regex would be used in the Parse function for this Name type.
Look at role.go in the core user package.
If we want to use regex Should it be written in the path below?
service/foundation/validate