code: func LoadDir(dir string) (*chart.Chart, error) {
  	topdir, err := filepath.Abs(dir)
  	if err != nil {
  		return nil, err
  	}
  
  	// Just used for errors.
  	c := &chart.Chart{}
  
  	rules := ignore.Empty()
  	ifile := filepath.Join(topdir, ignore.HelmIgnore)
  	if _, err := os.Stat(ifile); err == nil {
  		r, err := ignore.ParseFile(ifile)
  		if err != nil {
  			return c, err
  		}
  		rules = r
  	}
  	rules.AddDefaults()
  
  	files := []*BufferedFile{}
  	topdir += string(filepath.Separator)
  
  	walk := func(name string, fi os.FileInfo, err error) error {
  		n := strings.TrimPrefix(name, topdir)
  		if n == "" {
  			// No need to process top level. Avoid bug with helmignore .* matching
  			// empty names. See issue 1779.
  			return nil
  		}
  
  		// Normalize to / since it will also work on Windows
  		n = filepath.ToSlash(n)
  
  		if err != nil {
  			return err
  		}
  		if fi.IsDir() {
  			// Directory-based ignore rules should involve skipping the entire
  			// contents of that directory.
  			if rules.Ignore(n, fi) {
  				return filepath.SkipDir
  			}
  			return nil
  		}
  
  		// If a .helmignore file matches, skip this file.
  		if rules.Ignore(n, fi) {
  			return nil
  		}
  
  		data, err := ioutil.ReadFile(name)
  		if err != nil {
  			return fmt.Errorf("error reading %s: %s", n, err)
  		}
  
  		files = append(files, &BufferedFile{Name: n, Data: data})
  		return nil
  	}
  	if err = sympath.Walk(topdir, walk); err != nil {
  		return c, err
  	}
  
  	return LoadFiles(files)
  }
docs: // LoadDir loads from a directory.
  //
  // This loads charts only from directories.