code: func (m *Manager) safeDeleteDep(name, dir string) error {
  	files, err := filepath.Glob(filepath.Join(dir, name+"-*.tgz"))
  	if err != nil {
  		// Only for ErrBadPattern
  		return err
  	}
  	for _, fname := range files {
  		ch, err := chartutil.LoadFile(fname)
  		if err != nil {
  			fmt.Fprintf(m.Out, "Could not verify %s for deletion: %s (Skipping)", fname, err)
  			continue
  		}
  		if ch.Metadata.Name != name {
  			// This is not the file you are looking for.
  			continue
  		}
  		if err := os.Remove(fname); err != nil {
  			fmt.Fprintf(m.Out, "Could not delete %s: %s (Skipping)", fname, err)
  			continue
  		}
  	}
  	return nil
  }
docs: // safeDeleteDep deletes any versions of the given dependency in the given directory.
  //
  // It does this by first matching the file name to an expected pattern, then loading
  // the file to verify that it is a chart with the same name as the given name.
  //
  // Because it requires tar file introspection, it is more intensive than a basic delete.
  //
  // This will only return errors that should stop processing entirely. Other errors
  // will emit log messages or be ignored.