func (m *validator) ValidateLength(f, v string, min, max int) {
	if min > 0 {
		if utf8.RuneCountInString(v) < min {
			m.AddError(f, fmt.Sprint("minimum length is", min))
		}
	}
	if max > 0 {
		if utf8.RuneCountInString(v) > max {
			m.AddError(f, fmt.Sprint("maximum length is", max))
		}
	}
}
ValidateLength validates string min, max length. -1 for any
m.ValidateLength("password", m.Password, 6, 18) // min 6, max 18
package borm
import (
	"fmt"
	"regexp"
	"unicode/utf8"
)
type Errors map[string][]string
type validator struct {
	errors Errors
}
func (m *validator) ResetErrors() {
	m.errors = make(Errors)
}
func (m *validator) AddError(f string, t string) {
	if m.Valid() {
		m.errors = make(Errors)
	}
	m.errors[f] = append(m.errors[f], t)
}
func (m *validator) Valid() bool {
	return len(m.errors) == 0
}
func (m *validator) GetErrors() Errors {
	return m.errors
}
func (m *validator) SetErrors(e Errors) {
	m.errors = e
}
func (m *validator) ValidatePresence(f, v string) {
	if utf8.RuneCountInString(v) == 0 {
		m.AddError(f, "can't be blank")
	}
}