Beispiel #1
0
func validatePerson(p *person.Person) (err error) {
	// Ensure that the email is an actually email.
	if err = email.Validate(p.Email); err != nil {
		return
	}
	return
}
Beispiel #2
0
func (p *Password) Validate() (err error) {
	// Validate pasword
	if p.New != "" {
		if err = Validate(p.New); err != nil {
			return
		}
	}
	if p.Current != "" {
		if err = Validate(p.Current); err != nil {
			return
		}
	}
	// Validate email
	if err = email.Validate(p.Email); err != nil {
		return
	}
	return
}