code: func (u *DockerRegistryURL) baseURL(includeCredentials bool) string {
  	if u.Scheme == "" || u.Host == "" {
  		return ""
  	}
  
  	var result string
  	if u.Userinfo != nil && includeCredentials {
  		result = fmt.Sprintf("%s://%s@%s", u.Scheme, u.Userinfo, u.Host)
  	} else {
  		result = fmt.Sprintf("%s://%s", u.Scheme, u.Host)
  	}
  
  	if u.Port != "" {
  		result = fmt.Sprintf("%s:%s", result, u.Port)
  	}
  	return result
  
  }
docs: // baseURL is wrapped by BaseURL and BaseURLNoCredentials.
  // The boolean flag indicates whether credentials are included in the return string.