Created
December 26, 2019 22:09
-
-
Save L04DB4L4NC3R/04efd6e4659f7aab367523e52b0aa839 to your computer and use it in GitHub Desktop.
Clean Arch
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
package user | |
import "github.com/jinzhu/gorm" | |
type User struct { | |
gorm.Model | |
FirstName string `json:"first_name,omitempty"` | |
LastName string `json:"last_name,omitempty"` | |
Password string `json:"password,omitempty"` | |
PhoneNumber string `json:"phone_number,omitempty"` | |
Email string `json:"email,omitempty"` | |
Address string `json:"address,omitempty"` | |
DisplayPic string `json:"display_pic,omitempty"` | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
json
tag is actually an idiomatic way to represent what the names of the fields will be when this structure is encoded into JSON. It is not a path. Your conjecture about the password field is right, I just store the OAuth access token in the password field when doing Google login, since we have to explicitly serialize them anyway. I would love to know about your approach for the same.