code: func toString(name, target string, att *design.AttributeDefinition) string {
  	switch actual := att.Type.(type) {
  	case design.Primitive:
  		switch actual.Kind() {
  		case design.IntegerKind:
  			return fmt.Sprintf("%s := strconv.Itoa(%s)", target, name)
  		case design.BooleanKind:
  			return fmt.Sprintf("%s := strconv.FormatBool(%s)", target, name)
  		case design.NumberKind:
  			return fmt.Sprintf("%s := strconv.FormatFloat(%s, 'f', -1, 64)", target, name)
  		case design.StringKind:
  			return fmt.Sprintf("%s := %s", target, name)
  		case design.DateTimeKind:
  			return fmt.Sprintf("%s := %s.Format(time.RFC3339)", target, strings.Replace(name, "*", "", -1)) // remove pointer if present
  		case design.UUIDKind:
  			return fmt.Sprintf("%s := %s.String()", target, strings.Replace(name, "*", "", -1)) // remove pointer if present
  		case design.AnyKind:
  			return fmt.Sprintf("%s := fmt.Sprintf(\"%%v\", %s)", target, name)
  		case design.FileKind:
  			return fmt.Sprintf("%s := fmt.Sprintf(\"%%v\", %s)", target, name)
  		default:
  			panic("unknown primitive type")
  		}
  	case *design.Array:
  		data := map[string]interface{}{
  			"Name":     name,
  			"Target":   target,
  			"ElemType": actual.ElemType,
  		}
  		return codegen.RunTemplate(arrayToStringTmpl, data)
  	default:
  		panic("cannot convert non simple type " + att.Type.Name() + " to string") // bug
  	}
  }
docs: // toString generates Go code that converts the given simple type attribute into a string.