code: func NewValidator() *Validator {
  	var (
  		v   = &Validator{seen: make(map[string]*bytes.Buffer)}
  		err error
  	)
  	fm := template.FuncMap{
  		"tabs":             Tabs,
  		"slice":            toSlice,
  		"oneof":            oneof,
  		"constant":         constant,
  		"goifyAtt":         GoifyAtt,
  		"add":              Add,
  		"recurseAttribute": v.recurseAttribute,
  	}
  	v.arrayValT, err = template.New("array").Funcs(fm).Parse(arrayValTmpl)
  	if err != nil {
  		panic(err)
  	}
  	v.hashValT, err = template.New("hash").Funcs(fm).Parse(hashValTmpl)
  	if err != nil {
  		panic(err)
  	}
  	v.userValT, err = template.New("user").Funcs(fm).Parse(userValTmpl)
  	if err != nil {
  		panic(err)
  	}
  	return v
  }
docs: // NewValidator instantiates a validate code generator.