code: func (b BaseURL) WithProtocol(protocol string) (string, error) {
  	u := b.URL()
  
  	scheme := protocol
  	isFullProtocol := strings.HasSuffix(scheme, "://")
  	isOpaqueProtocol := strings.HasSuffix(scheme, ":")
  
  	if isFullProtocol {
  		scheme = strings.TrimSuffix(scheme, "://")
  	} else if isOpaqueProtocol {
  		scheme = strings.TrimSuffix(scheme, ":")
  	}
  
  	u.Scheme = scheme
  
  	if isFullProtocol && u.Opaque != "" {
  		u.Opaque = "//" + u.Opaque
  	} else if isOpaqueProtocol && u.Opaque == "" {
  		return "", fmt.Errorf("cannot determine BaseURL for protocol %q", protocol)
  	}
  
  	return u.String(), nil
  }
docs: // WithProtocol returns the BaseURL prefixed with the given protocol.
  // The Protocol is normally of the form "scheme://", i.e. "webcal://".