func reposInternal(paths *[]string, rootpath string, rootpattern string, pattern string, allowSymlinks bool) {
	// check if the current directory is a git repository
	// and if so, return a list containing this repo
	if isGitRepoRoot(rootpath) {
		// fmt.Printf("matching %q against %q\n", pattern, rootpattern) // for debugging
		if MatchesString(pattern, rootpattern) {
			*paths = append(*paths, rootpath)
		}
		return
	}

	// read all the folders in this directory
	// but bail out if an error occurs
	files, err := ioutil.ReadDir(rootpath)
	if err != nil {
		return
	}

	// iterate over all the subdirectories
	// and recursively call this function on all sub-directories
	for _, f := range files {
		// get name and path of the file
		name := f.Name()
		fn := path.Join(rootpath, name)

		// resolve symlink (if needed)
		wasLink, _ := resolveSymlinks(fn, &f)

		// and if it is a directory, recurse
		if f.IsDir() {
			reposInternal(paths, fn, path.Join(rootpattern, name), pattern, !wasLink)
		}
	}
}
// reposInternal is the internal implementation of the Repos function
reposInternal is the internal implementation of the Repos function
// reposInternal is the internal implementation of the Repos function
func reposInternal(paths *[]string, rootpath string, rootpattern string, pattern string, allowSymlinks bool) {
	if isGitRepoRoot(rootpath) {
		if MatchesString(pattern, rootpattern) {
			*paths = append(*paths, rootpath)
		}
		return
	}
	files, err := ioutil.ReadDir(rootpath)
	if err != nil {
		return
	}
	for _, f := range files {
		name := f.Name()
		fn := path.Join(rootpath, name)
		wasLink, _ := resolveSymlinks(fn, &f)
		if f.IsDir() {
			reposInternal(paths, fn, path.Join(rootpattern, name), pattern, !wasLink)
		}
	}
}
func reposInternal ( paths * [ ] string , rootpath string , rootpattern string , pattern string , allowSymlinks bool ) { if isGitRepoRoot ( rootpath ) { if MatchesString ( pattern , rootpattern ) { * paths = append ( * paths , rootpath ) } return } files , err := ioutil . ReadDir ( rootpath ) if err != nil { return } for _ , f := range files { name := f . Name ( ) fn := path . Join ( rootpath , name ) wasLink , _ := resolveSymlinks ( fn , & f ) if f . IsDir ( ) { reposInternal ( paths , fn , path . Join ( rootpattern , name ) , pattern , ! wasLink ) } } }
reposInternal is the internal implementation of the Repos function
reposInternal is the internal implementation of the Repos function
// check if the current directory is a git repository // and if so, return a list containing this repo // fmt.Printf("matching %q against %q\n", pattern, rootpattern) // for debugging // read all the folders in this directory // but bail out if an error occurs // iterate over all the subdirectories // and recursively call this function on all sub-directories // get name and path of the file // resolve symlink (if needed) // and if it is a directory, recurse