code: func Format(f string) {
  	if a, ok := attributeDefinition(); ok {
  		if a.Type != nil && a.Type.Kind() != design.StringKind {
  			incompatibleAttributeType("format", a.Type.Name(), "a string")
  		} else {
  			supported := false
  			for _, s := range SupportedValidationFormats {
  				if s == f {
  					supported = true
  					break
  				}
  			}
  			if !supported {
  				dslengine.ReportError("unsupported format %#v, supported formats are: %s",
  					f, strings.Join(SupportedValidationFormats, ", "))
  			} else {
  				if a.Validation == nil {
  					a.Validation = &dslengine.ValidationDefinition{}
  				}
  				a.Validation.Format = f
  			}
  		}
  	}
  }
docs: // Format can be used in: Attribute, Header, Param, HashOf, ArrayOf
  //
  // Format adds a "format" validation to the attribute.
  // See http://json-schema.org/latest/json-schema-validation.html#anchor104.
  // The formats supported by goa are:
  //
  // "date": RFC3339 date
  //
  // "date-time": RFC3339 date time
  //
  // "email": RFC5322 email address
  //
  // "hostname": RFC1035 internet host name
  //
  // "ipv4", "ipv6", "ip": RFC2373 IPv4, IPv6 address or either
  //
  // "uri": RFC3986 URI
  //
  // "mac": IEEE 802 MAC-48, EUI-48 or EUI-64 MAC address
  //
  // "cidr": RFC4632 or RFC4291 CIDR notation IP address
  //
  // "regexp": RE2 regular expression
  //
  // "rfc1123": RFC1123 date time