code: func ValidationChecker(att *design.AttributeDefinition, nonzero, required, hasDefault bool, target, context string, depth int, private bool) string {
  	if att.Validation == nil {
  		return ""
  	}
  	t := target
  	isPointer := private || (!required && !hasDefault && !nonzero)
  	if isPointer && att.Type.IsPrimitive() {
  		t = "*" + t
  	}
  	data := map[string]interface{}{
  		"attribute": att,
  		"isPointer": private || isPointer,
  		"nonzero":   nonzero,
  		"context":   context,
  		"target":    target,
  		"targetVal": t,
  		"string":    att.Type.Kind() == design.StringKind,
  		"array":     att.Type.IsArray(),
  		"hash":      att.Type.IsHash(),
  		"depth":     depth,
  		"private":   private,
  	}
  	res := validationsCode(att, data)
  	return strings.Join(res, "\n")
  }
docs: // ValidationChecker produces Go code that runs the validation defined in the given attribute
  // definition against the content of the variable named target recursively.
  // context is used to keep track of recursion to produce helpful error messages in case of type
  // validation error.
  // The generated code assumes that there is a pre-existing "err" variable of type
  // error. It initializes that variable in case a validation fails.
  // Note: we do not want to recurse here, recursion is done by the marshaler/unmarshaler code.