diff options
author | Russ Cox <rsc@golang.org> | 2022-11-29 13:30:50 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2023-02-23 10:10:21 +0000 |
commit | bd8ec78b08ead1fb34ec8dc7bc4bf2ff7a9e8b82 (patch) | |
tree | a9a2e48a8fd8551cbc3fc39dc91a6ae8e0682f50 /api | |
parent | f07fafacef04e8a8eaf2c8d2e1a14dc88e8683ee (diff) | |
download | go-git-bd8ec78b08ead1fb34ec8dc7bc4bf2ff7a9e8b82.tar.gz |
cmd/go, go/build: parse directives in file headers
For #56986, go/build needs to report up to cmd/go
about //go:debug lines found in the source code.
Rather than make a special case for //go:debug,
this change gathers all top-level directives above the
package line and includes them in the result.
The go command's module index must match go/build,
so this CL contains the code to update the index as well.
A future CL will use the //go:debug lines to prepare the default
GODEBUG settings, as well as rejecting such lines in non-main
packages.
Change-Id: I66ab8dc72f9cd65c503b10b744367caca233f8a6
Reviewed-on: https://go-review.googlesource.com/c/go/+/453603
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'api')
-rw-r--r-- | api/next/56986.txt | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/api/next/56986.txt b/api/next/56986.txt new file mode 100644 index 0000000000..9ccb869f11 --- /dev/null +++ b/api/next/56986.txt @@ -0,0 +1,6 @@ +pkg go/build, type Directive struct #56986 +pkg go/build, type Directive struct, Pos token.Position #56986 +pkg go/build, type Directive struct, Text string #56986 +pkg go/build, type Package struct, Directives []Directive #56986 +pkg go/build, type Package struct, TestDirectives []Directive #56986 +pkg go/build, type Package struct, XTestDirectives []Directive #56986 |