code: func FormatFromMediaType(mt string, params map[string]string) (Format, error) {
  	switch mt {
  	case ContentTypePRPC:
  		for k := range params {
  			if k != mtPRPCEncoding {
  				return 0, fmt.Errorf("unexpected parameter %q", k)
  			}
  		}
  		return FormatFromEncoding(params[mtPRPCEncoding])
  
  	case ContentTypeJSON:
  		return FormatJSONPB, nil
  
  	case "", "*/*", "application/*", "application/grpc":
  		return FormatBinary, nil
  
  	default:
  		return 0, fmt.Errorf("unknown content type: %q", mt)
  	}
  }
docs: // FormatFromMediaType converts a media type ContentType and its parameters
  // into a pRPC Format.
  // Can return only FormatBinary, FormatJSONPB or FormatText.
  // In case of an error, format is undefined.