ch16.3
This commit is contained in:
@@ -15,6 +15,8 @@ var (
|
||||
ErrDuplicateEmail = errors.New("duplicate email")
|
||||
)
|
||||
|
||||
var AnonymousUser = &User{}
|
||||
|
||||
type User struct {
|
||||
ID int64 `json:"id"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
@@ -25,6 +27,10 @@ type User struct {
|
||||
Version int `json:"-"`
|
||||
}
|
||||
|
||||
func (u *User) IsAnonymous() bool {
|
||||
return u == AnonymousUser
|
||||
}
|
||||
|
||||
type password struct {
|
||||
plaintext *string
|
||||
hash []byte
|
||||
|
||||
Reference in New Issue
Block a user