go-chat/user/user.go

18 lines
240 B
Go
Raw Normal View History

2021-04-22 06:12:35 +00:00
package user
import "errors"
type User struct {
Id int
Name string
Sex int8
Password string
}
func (u *User) CheckPassword(p string) error {
if p != u.Password {
return errors.New("password error")
}
return nil
}