]> Cypherpunks repositories - gostls13.git/commit
go/build: recognize and report //go:embed lines
authorRuss Cox <rsc@golang.org>
Mon, 19 Oct 2020 11:46:09 +0000 (07:46 -0400)
committerRuss Cox <rsc@golang.org>
Thu, 22 Oct 2020 01:20:16 +0000 (01:20 +0000)
commit4c7a18d74ae4d574313c01e95de66be06e3a3e82
tree96649e6877262490d76d41fca45e36320df3cf4e
parenta29dd1f2bd0ee0048f03782ba67034a0441a147e
go/build: recognize and report //go:embed lines

The code in this CL does the work of looking for the "embed" import
and then finding and recording the arguments to //go:embed lines
in Go source files. The go command will use this information to prepare
information about embedded files to pass to the compiler.

The tests of the Package fields end up being end-to-end via the
go command (added in the CL with the go command changes),
like all the other Package fields.

For #41191.

Change-Id: I0c87b71ca809c0031603cc403c030d3088299e6b
Reviewed-on: https://go-review.googlesource.com/c/go/+/243941
Trust: Russ Cox <rsc@golang.org>
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/go/build/build.go
src/go/build/read.go
src/go/build/read_test.go