Created
June 24, 2021 11:39
-
-
Save dipeshhkc/2281ee7d5564dbd82fa6aa9da0265076 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//User -> model for users table | |
type User struct { | |
gorm.Model | |
Name string `json:"name" ` | |
Email string `json:"email" gorm:"unique"` | |
Role string `json:"role" gorm:"-"` | |
Password string `json:"password" ` | |
} | |
//TableName --> Table for Product Model | |
func (User) TableName() string { | |
return "users" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment