1
0
mirror of https://github.com/golang/go synced 2024-09-23 17:10:13 -06:00

cmd/go: add documentation for test and xtest fields output by go list

The TestEmbedPatterns, TestEmbedFiles, XTestEmbedPatterns, and
XTestEmbedFiles fields were left out of golang.org/cl/282195 which was
supposed to document the embed fields available in the go list
output. Add documentation for them in this CL.

Fixes #43081

Change-Id: Ifc256c476daec7c0f0e2c41f86b82f958b3e2b1a
Reviewed-on: https://go-review.googlesource.com/c/go/+/284258
Trust: Michael Matloob <matloob@golang.org>
Run-TryBot: Michael Matloob <matloob@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
This commit is contained in:
Michael Matloob 2021-01-15 19:41:26 -05:00
parent b268b60774
commit a1b53d85da
3 changed files with 15 additions and 7 deletions

View File

@ -787,8 +787,12 @@
// XTestGoFiles []string // _test.go files outside package
//
// // Embedded files
// EmbedPatterns []string // //go:embed patterns
// EmbedFiles []string // files and directories matched by EmbedPatterns
// EmbedPatterns []string // //go:embed patterns
// EmbedFiles []string // files matched by EmbedPatterns
// TestEmbedPatterns []string // //go:embed patterns in TestGoFiles
// TestEmbedFiles []string // files matched by TestEmbedPatterns
// XTestEmbedPatterns []string // //go:embed patterns in XTestGoFiles
// XTestEmbedFiles []string // files matched by XTestEmbedPatterns
//
// // Cgo directives
// CgoCFLAGS []string // cgo: flags for C compiler

View File

@ -90,8 +90,12 @@ to -f '{{.ImportPath}}'. The struct being passed to the template is:
XTestGoFiles []string // _test.go files outside package
// Embedded files
EmbedPatterns []string // //go:embed patterns
EmbedFiles []string // files and directories matched by EmbedPatterns
EmbedPatterns []string // //go:embed patterns
EmbedFiles []string // files matched by EmbedPatterns
TestEmbedPatterns []string // //go:embed patterns in TestGoFiles
TestEmbedFiles []string // files matched by TestEmbedPatterns
XTestEmbedPatterns []string // //go:embed patterns in XTestGoFiles
XTestEmbedFiles []string // files matched by XTestEmbedPatterns
// Cgo directives
CgoCFLAGS []string // cgo: flags for C compiler

View File

@ -96,7 +96,7 @@ type PackagePublic struct {
// Embedded files
EmbedPatterns []string `json:",omitempty"` // //go:embed patterns
EmbedFiles []string `json:",omitempty"` // files and directories matched by EmbedPatterns
EmbedFiles []string `json:",omitempty"` // files matched by EmbedPatterns
// Cgo directives
CgoCFLAGS []string `json:",omitempty"` // cgo: flags for C compiler
@ -122,11 +122,11 @@ type PackagePublic struct {
TestGoFiles []string `json:",omitempty"` // _test.go files in package
TestImports []string `json:",omitempty"` // imports from TestGoFiles
TestEmbedPatterns []string `json:",omitempty"` // //go:embed patterns
TestEmbedFiles []string `json:",omitempty"` // //files matched by EmbedPatterns
TestEmbedFiles []string `json:",omitempty"` // files matched by TestEmbedPatterns
XTestGoFiles []string `json:",omitempty"` // _test.go files outside package
XTestImports []string `json:",omitempty"` // imports from XTestGoFiles
XTestEmbedPatterns []string `json:",omitempty"` // //go:embed patterns
XTestEmbedFiles []string `json:",omitempty"` // //files matched by EmbedPatterns
XTestEmbedFiles []string `json:",omitempty"` // files matched by XTestEmbedPatterns
}
// AllFiles returns the names of all the files considered for the package.