fix: add comments

This commit is contained in:
Elton Minetto
2020-10-12 08:16:08 -03:00
parent 34b252f708
commit b1020aef90
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -2,12 +2,15 @@ package entity
import "github.com/google/uuid"
//ID entity ID
type ID = uuid.UUID
//NewID create a new entity ID
func NewID() ID {
return ID(uuid.New())
}
//StringToID convert a string to an entity ID
func StringToID(s string) (ID, error) {
id, err := uuid.Parse(s)
return ID(id), err
+1 -1
View File
@@ -79,7 +79,7 @@ func (u *User) Validate() error {
return nil
}
//ValidatePassword
//ValidatePassword validate user password
func (u *User) ValidatePassword(p string) error {
err := bcrypt.CompareHashAndPassword([]byte(u.Password), []byte(p))
if err != nil {