code: func (m *Manager) loadChartRepositories() (map[string]*repo.ChartRepository, error) {
  	indices := map[string]*repo.ChartRepository{}
  	repoyaml := m.HelmHome.RepositoryFile()
  
  	// Load repositories.yaml file
  	rf, err := repo.LoadRepositoriesFile(repoyaml)
  	if err != nil {
  		return indices, fmt.Errorf("failed to load %s: %s", repoyaml, err)
  	}
  
  	for _, re := range rf.Repositories {
  		lname := re.Name
  		cacheindex := m.HelmHome.CacheIndex(lname)
  		index, err := repo.LoadIndexFile(cacheindex)
  		if err != nil {
  			return indices, err
  		}
  
  		// TODO: use constructor
  		cr := &repo.ChartRepository{
  			Config:    re,
  			IndexFile: index,
  		}
  		indices[lname] = cr
  	}
  	return indices, nil
  }
docs: // loadChartRepositories reads the repositories.yaml, and then builds a map of
  // ChartRepositories.
  //
  // The key is the local name (which is only present in the repositories.yaml).