code: func (i IndexFile) Get(name, version string) (*ChartVersion, error) {
  	vs, ok := i.Entries[name]
  	if !ok {
  		return nil, ErrNoChartName
  	}
  	if len(vs) == 0 {
  		return nil, ErrNoChartVersion
  	}
  
  	var constraint *semver.Constraints
  	if len(version) == 0 {
  		constraint, _ = semver.NewConstraint("*")
  	} else {
  		var err error
  		constraint, err = semver.NewConstraint(version)
  		if err != nil {
  			return nil, err
  		}
  	}
  
  	// when customer input exact version, check whether have exact match one first
  	if len(version) != 0 {
  		for _, ver := range vs {
  			if version == ver.Version {
  				return ver, nil
  			}
  		}
  	}
  
  	for _, ver := range vs {
  		test, err := semver.NewVersion(ver.Version)
  		if err != nil {
  			continue
  		}
  
  		if constraint.Check(test) {
  			return ver, nil
  		}
  	}
  	return nil, fmt.Errorf("No chart version found for %s-%s", name, version)
  }
docs: // Get returns the ChartVersion for the given name.
  //
  // If version is empty, this will return the chart with the highest version.