code: func ScanDir(dir string) ([]Name, error) {
  	globPattern := filepath.Join(dir, "*.whl")
  	matches, err := filepath.Glob(globPattern)
  	if err != nil {
  		return nil, errors.Annotate(err, "failed to list wheel directory: %s", dir).
  			InternalReason("pattern(%s)", globPattern).Err()
  	}
  
  	names := make([]Name, 0, len(matches))
  	for _, match := range matches {
  		switch st, err := os.Stat(match); {
  		case err != nil:
  			return nil, errors.Annotate(err, "failed to stat wheel: %s", match).Err()
  
  		case st.IsDir():
  			// Ignore directories.
  			continue
  
  		default:
  			// A ".whl" file.
  			name := filepath.Base(match)
  			wheelName, err := ParseName(name)
  			if err != nil {
  				return nil, errors.Annotate(err, "failed to parse wheel from: %s", name).
  					InternalReason("dir(%s)", dir).Err()
  			}
  			names = append(names, wheelName)
  		}
  	}
  	return names, nil
  }
docs: // ScanDir identifies all wheel files in the immediate directory dir and
  // returns their parsed wheel names.