AllPackages returns the package path of each Go package in any source directory of the specified build context (e.g. $GOROOT or an element of $GOPATH). Errors are ignored. The results are sorted. All package paths are canonical, and thus may contain "/vendor/".

The result may include import paths for directories that contain no *.go files, such as "archive" (in $GOROOT/src).

All I/O is done via the build.Context file system interface, which must be concurrency-safe.

AllPackages is referenced in 0 repositories