|
5 | 5 | /*
|
6 | 6 | Package packages loads Go packages for inspection and analysis.
|
7 | 7 |
|
8 |
| -The Load function takes as input a list of patterns and return a list of Package |
9 |
| -structs describing individual packages matched by those patterns. |
10 |
| -The LoadMode controls the amount of detail in the loaded packages. |
11 |
| -
|
12 |
| -Load passes most patterns directly to the underlying build tool, |
13 |
| -but all patterns with the prefix "query=", where query is a |
| 8 | +The [Load] function takes as input a list of patterns and returns a |
| 9 | +list of [Package] values describing individual packages matched by those |
| 10 | +patterns. |
| 11 | +A [Config] specifies configuration options, the most important of which is |
| 12 | +the [LoadMode], which controls the amount of detail in the loaded packages. |
| 13 | +
|
| 14 | +Load passes most patterns directly to the underlying build tool. |
| 15 | +The default build tool is the go command. |
| 16 | +Its supported patterns are described at |
| 17 | +https://pkg.go.dev/cmd/go#hdr-Package_lists_and_patterns. |
| 18 | +
|
| 19 | +Load may be used in Go projects that use alternative build systems, by |
| 20 | +installing an appropriate "driver" program for the build system and |
| 21 | +specifying its location in the GOPACKAGESDRIVER environment variable. |
| 22 | +For example, |
| 23 | +https://github.com/bazelbuild/rules_go/wiki/Editor-and-tool-integration |
| 24 | +explains how to use the driver for Bazel. |
| 25 | +The driver program is responsible for interpreting patterns in its |
| 26 | +preferred notation and reporting information about the packages that |
| 27 | +they identify. |
| 28 | +(See driverRequest and driverResponse types for the JSON |
| 29 | +schema used by the protocol. |
| 30 | +Though the protocol is supported, these types are currently unexported; |
| 31 | +see #64608 for a proposal to publish them.) |
| 32 | +
|
| 33 | +Regardless of driver, all patterns with the prefix "query=", where query is a |
14 | 34 | non-empty string of letters from [a-z], are reserved and may be
|
15 | 35 | interpreted as query operators.
|
16 | 36 |
|
@@ -64,7 +84,7 @@ reported about the loaded packages. See the documentation for type LoadMode
|
64 | 84 | for details.
|
65 | 85 |
|
66 | 86 | Most tools should pass their command-line arguments (after any flags)
|
67 |
| -uninterpreted to the loader, so that the loader can interpret them |
| 87 | +uninterpreted to [Load], so that it can interpret them |
68 | 88 | according to the conventions of the underlying build system.
|
69 | 89 | See the Example function for typical usage.
|
70 | 90 | */
|
|
0 commit comments