Skip to content

Commit a1b53d8

Browse files
committed
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 <[email protected]> Run-TryBot: Michael Matloob <[email protected]> Reviewed-by: Jay Conrod <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]>
1 parent b268b60 commit a1b53d8

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

src/cmd/go/alldocs.go

Lines changed: 6 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/go/internal/list/list.go

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,12 @@ to -f '{{.ImportPath}}'. The struct being passed to the template is:
9090
XTestGoFiles []string // _test.go files outside package
9191
9292
// Embedded files
93-
EmbedPatterns []string // //go:embed patterns
94-
EmbedFiles []string // files and directories matched by EmbedPatterns
93+
EmbedPatterns []string // //go:embed patterns
94+
EmbedFiles []string // files matched by EmbedPatterns
95+
TestEmbedPatterns []string // //go:embed patterns in TestGoFiles
96+
TestEmbedFiles []string // files matched by TestEmbedPatterns
97+
XTestEmbedPatterns []string // //go:embed patterns in XTestGoFiles
98+
XTestEmbedFiles []string // files matched by XTestEmbedPatterns
9599
96100
// Cgo directives
97101
CgoCFLAGS []string // cgo: flags for C compiler

src/cmd/go/internal/load/pkg.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ type PackagePublic struct {
9696

9797
// Embedded files
9898
EmbedPatterns []string `json:",omitempty"` // //go:embed patterns
99-
EmbedFiles []string `json:",omitempty"` // files and directories matched by EmbedPatterns
99+
EmbedFiles []string `json:",omitempty"` // files matched by EmbedPatterns
100100

101101
// Cgo directives
102102
CgoCFLAGS []string `json:",omitempty"` // cgo: flags for C compiler
@@ -122,11 +122,11 @@ type PackagePublic struct {
122122
TestGoFiles []string `json:",omitempty"` // _test.go files in package
123123
TestImports []string `json:",omitempty"` // imports from TestGoFiles
124124
TestEmbedPatterns []string `json:",omitempty"` // //go:embed patterns
125-
TestEmbedFiles []string `json:",omitempty"` // //files matched by EmbedPatterns
125+
TestEmbedFiles []string `json:",omitempty"` // files matched by TestEmbedPatterns
126126
XTestGoFiles []string `json:",omitempty"` // _test.go files outside package
127127
XTestImports []string `json:",omitempty"` // imports from XTestGoFiles
128128
XTestEmbedPatterns []string `json:",omitempty"` // //go:embed patterns
129-
XTestEmbedFiles []string `json:",omitempty"` // //files matched by EmbedPatterns
129+
XTestEmbedFiles []string `json:",omitempty"` // files matched by XTestEmbedPatterns
130130
}
131131

132132
// AllFiles returns the names of all the files considered for the package.

0 commit comments

Comments
 (0)