code: func ReadPatterns(fs billy.Filesystem, path []string) (ps []Pattern, err error) {
  	ps, _ = readIgnoreFile(fs, path, gitignoreFile)
  
  	var fis []os.FileInfo
  	fis, err = fs.ReadDir(fs.Join(path...))
  	if err != nil {
  		return
  	}
  
  	for _, fi := range fis {
  		if fi.IsDir() && fi.Name() != gitDir {
  			var subps []Pattern
  			subps, err = ReadPatterns(fs, append(path, fi.Name()))
  			if err != nil {
  				return
  			}
  
  			if len(subps) > 0 {
  				ps = append(ps, subps...)
  			}
  		}
  	}
  
  	return
  }
docs: // ReadPatterns reads gitignore patterns recursively traversing through the directory
  // structure. The result is in the ascending order of priority (last higher).