code: func (s *sourceFile) extractFromDir(name string) ([]*v1.Pod, error) {
  	dirents, err := filepath.Glob(filepath.Join(name, "[^.]*"))
  	if err != nil {
  		return nil, fmt.Errorf("glob failed: %v", err)
  	}
  
  	pods := make([]*v1.Pod, 0)
  	if len(dirents) == 0 {
  		return pods, nil
  	}
  
  	sort.Strings(dirents)
  	for _, path := range dirents {
  		statInfo, err := os.Stat(path)
  		if err != nil {
  			klog.Errorf("Can't get metadata for %q: %v", path, err)
  			continue
  		}
  
  		switch {
  		case statInfo.Mode().IsDir():
  			klog.Errorf("Not recursing into manifest path %q", path)
  		case statInfo.Mode().IsRegular():
  			pod, err := s.extractFromFile(path)
  			if err != nil {
  				if !os.IsNotExist(err) {
  					klog.Errorf("Can't process manifest file %q: %v", path, err)
  				}
  			} else {
  				pods = append(pods, pod)
  			}
  		default:
  			klog.Errorf("Manifest path %q is not a directory or file: %v", path, statInfo.Mode())
  		}
  	}
  	return pods, nil
  }
docs: // Get as many pod manifests as we can from a directory. Return an error if and only if something
  // prevented us from reading anything at all. Do not return an error if only some files
  // were problematic.