code: func ValidateHostname(hostname string) error {
  	if len(hostname) > 255 {
  		return fmt.Errorf("length exceeds 255 bytes")
  	}
  	if !hostnameRegexp.MatchString(hostname) {
  		return fmt.Errorf("hostname does not match regex %q", hostnameRegexp)
  	}
  	for _, s := range strings.Split(hostname, ".") {
  		if len(s) > 63 {
  			return fmt.Errorf("segment %q exceeds 63 bytes", s)
  		}
  	}
  	return nil
  }
docs: // ValidateHostname returns an error if the given string is not a valid
  // RFC1123 hostname.