code: func glob(fs Fs, dir, pattern string, matches []string) (m []string, e error) {
  	m = matches
  	fi, err := fs.Stat(dir)
  	if err != nil {
  		return
  	}
  	if !fi.IsDir() {
  		return
  	}
  	d, err := fs.Open(dir)
  	if err != nil {
  		return
  	}
  	defer d.Close()
  
  	names, _ := d.Readdirnames(-1)
  	sort.Strings(names)
  
  	for _, n := range names {
  		matched, err := filepath.Match(pattern, n)
  		if err != nil {
  			return m, err
  		}
  		if matched {
  			m = append(m, filepath.Join(dir, n))
  		}
  	}
  	return
  }
docs: // glob searches for files matching pattern in the directory dir
  // and appends them to matches. If the directory cannot be
  // opened, it returns the existing matches. New matches are
  // added in lexicographical order.