func GenerateHash(password string) ([]byte, error) {
	hex := []byte(password)
	hashedPassword, err := bcrypt.GenerateFromPassword(hex, 10)
	if err != nil {
		return hashedPassword, err
	}
	return hashedPassword, nil
}
GenerateHash generates bcrypt hash from plaintext password
package sqlx
import (
	"errors"
	"log"
	"time"
	"github.com/pborman/uuid"
	"golang.org/x/crypto/bcrypt"
)
type User struct {
	ID       int64  `json:"id"`
	Name     string `json:"name" form:"name"`
	Password string `json:"password,omitempty" form:"password" sql:"-"`
	Recovery string `json:"-"`
	Digest   []byte `json:"-"`
	Email    string `json:"email" form:"email" binding:"required"`
	Posts    []Post `json:"posts"`
	Location string `json:"location" form:"location"`
}