Skip to content

Instantly share code, notes, and snippets.

@Solution
Last active May 13, 2021 10:33
Show Gist options
  • Save Solution/44c2e69acd24d9f484d5a5ab3bf72014 to your computer and use it in GitHub Desktop.
Save Solution/44c2e69acd24d9f484d5a5ab3bf72014 to your computer and use it in GitHub Desktop.
type User struct {
gorm.Model
Username string
Firstname string
Surname string
Email string
Phone string
Password string
Role string
Active bool
}
FindExistingUser(username string) model.User {
var user model.User
database.Where("username = ?", username).First(&user)
return user
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment