func Description(input, fieldName string) error {
	if len(input) <= 500 {
		return nil
	}
	return NewValidationError(fieldName + " descriptions must be less than 500 characters")
}
Description validates whether the input meets the descriptin requirements
package validate
import (
	"fmt"
	"github.com/asaskevich/govalidator"
	"github.com/manifoldco/promptui"
)
const slugPattern = "^[a-z][a-z0-9\\-\\_]{0,63}$"
const namePattern = "^[a-zA-Z\\s,\\.'\\-pL]{3,64}$"
const inviteCodePattern = "(?i)^[0-9a-ht-zjkmnpqr]{10}$"
const verifyCodePattern = "(?i)^[0-9a-ht-zjkmnpqr]{9}$"
const slugErrorPattern = "%s must be between 1 and 64 characters in length and only contain alphabetical letters, numbers, hyphens, and underscores."
const nameErrorPattern = "%s must be between 3 and 64 characters in length and only contain letters, commas, periods, apostraphes, and hyphens."
var ProjectName Func
var OrgName Func
var TeamName Func
var RoleName Func
var PolicyName Func
var Username Func
func init() {
	ProjectName = SlugValidator("Project names")
	OrgName = SlugValidator("Org names")
	TeamName = SlugValidator("Team names")
	RoleName = SlugValidator("Machine role names")
	Username = SlugValidator("Usernames")
	PolicyName = SlugValidator("Policy names")
}
type ValidationError struct {
	msg string
}
func (e *ValidationError) Error() string {
	return e.msg
}
func NewValidationError(msg string) error {
	return &ValidationError{msg: msg}
}
type Func promptui.ValidateFunc
func Confirmer(defaultYes bool) Func {
	return func(input string) error {
		if defaultYes {
			if input == "" || input == "y" || input == "N" {
				return nil
			}
			return NewValidationError("You must specify either 'y' for yes or 'N' for no.")
		}
		if input == "" || input == "Y" || input == "n" {
			return nil
		}
		return NewValidationError("You must specify either 'Y' for yes or 'n' for no.")
	}
}
func OneOf(choices []string) Func {
	return func(input string) error {
		for _, v := range choices {
			if input == v {
				return nil
			}
		}
		return NewValidationError(fmt.Sprintf("%s is not a valid option.", input))
	}
}
func SlugValidator(fieldName string) Func {
	return func(input string) error {
		if govalidator.StringMatches(input, slugPattern) {
			return nil
		}
		return NewValidationError(fmt.Sprintf(slugErrorPattern, fieldName))
	}
}
func InviteCode(input string) error {
	if govalidator.StringMatches(input, inviteCodePattern) {
		return nil
	}
	return NewValidationError("Please enter a valid invite code. Make sure to copy the entire code from the email!")
}
func VerificationCode(input string) error {
	if govalidator.StringMatches(input, verifyCodePattern) {
		return nil
	}
	return NewValidationError("Please enter a valid verification code. Make sure to copy the entire code from the email!")
}