code: func findChartURL(name, version, repoURL string, repos map[string]*repo.ChartRepository) (url, username, password string, err error) {
  	for _, cr := range repos {
  		if urlutil.Equal(repoURL, cr.Config.URL) {
  			var entry repo.ChartVersions
  			entry, err = findEntryByName(name, cr)
  			if err != nil {
  				return
  			}
  			var ve *repo.ChartVersion
  			ve, err = findVersionedEntry(version, entry)
  			if err != nil {
  				return
  			}
  			url, err = normalizeURL(repoURL, ve.URLs[0])
  			if err != nil {
  				return
  			}
  			username = cr.Config.Username
  			password = cr.Config.Password
  			return
  		}
  	}
  	err = fmt.Errorf("chart %s not found in %s", name, repoURL)
  	return
  }
docs: // findChartURL searches the cache of repo data for a chart that has the name and the repoURL specified.
  //
  // 'name' is the name of the chart. Version is an exact semver, or an empty string. If empty, the
  // newest version will be returned.
  //
  // repoURL is the repository to search
  //
  // If it finds a URL that is "relative", it will prepend the repoURL.