ReadDir implements the FileSystem ReadDir method. It's where most of the magic is. (The rest is in resolve.)
Logically, ReadDir must return the union of all the directories that are named by path. In order to avoid misinterpreting Go packages, of all the directories that contain Go source code, we only include the files from the first, but we include subdirectories from all.
ReadDir must also return directory entries needed to reach mount points. If the name space looks like the example in the type NameSpace comment, but c:\Go does not have a src/pkg subdirectory, we still want to be able to find that subdirectory, because we've mounted d:\Work1 and d:\Work2 there. So if we don't see "src" in the directory listing for c:\Go, we add an entry for it before returning.
ReadDir is referenced in 11 repositoriesgithub.com/golang/tools
- 1 reference in cmd/godoc/codewalk.go
- 1 reference in src/code.google.com/p/go.tools/cmd/godoc/codewalk.go
- 1 reference in src/golang.org/x/tools/cmd/godoc/codewalk.go
- 1 reference in codewalk.go