diff --git a/go/packages/doc.go b/go/packages/doc.go index e645651f..c8782cb2 100644 --- a/go/packages/doc.go +++ b/go/packages/doc.go @@ -19,21 +19,20 @@ but all patterns with the prefix "query=", where query is a non-empty string of letters from [a-z], are reserved and may be interpreted as query operators. -Only two query operators are currently supported, "file" and "pattern". +Three query operators are currently supported: "file", "pattern", and "name". The query "file=path/to/file.go" matches the package or packages enclosing the Go source file path/to/file.go. For example "file=~/go/src/fmt/print.go" -might returns the packages "fmt" and "fmt [fmt.test]". +might return the packages "fmt" and "fmt [fmt.test]". The query "pattern=string" causes "string" to be passed directly to the underlying build tool. In most cases this is unnecessary, but an application can use Load("pattern=" + x) as an escaping mechanism to ensure that x is not interpreted as a query operator if it contains '='. -A third query "name=identifier" will be added soon. -It will match packages whose package declaration contains the specified identifier. -For example, "name=rand" would match the packages "math/rand" and "crypto/rand", -and "name=main" would match all executables. +The query "name=identifier" matches packages whose package declaration contains +the specified identifier. For example, "name=rand" would match the packages +"math/rand" and "crypto/rand", and "name=main" would match all executables. All other query operators are reserved for future use and currently cause Load to report an error.