this post was submitted on 21 Jun 2023
2 points (100.0% liked)
Go programming language discussion
1280 readers
1 users here now
founded 5 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Hello, Thanks for responding. ^^
i didn't want to make any changes to the id field.
i have a user struct like this.
i wanted the Email field to be unique, just like the ID. so when a new user tries to create an account with the same email, it'll return an error.
it isn't a problem anymore because i figured out a way... i created a custom struct tag that validates whether a user with the same email exist in the database.