aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Matloob <matloob@golang.org>2021-01-15 19:41:26 -0500
committerMichael Matloob <matloob@golang.org>2021-01-22 18:51:44 +0000
commita1b53d85dad7648d545ee5e0d7e768f300bfcd84 (patch)
treee6f0ba47389a3c5ba574f6fe8ddba86a69a4cb90
parentb268b607743ebf570396750208e0032870653edd (diff)
downloadgo-a1b53d85dad7648d545ee5e0d7e768f300bfcd84.tar.gz
go-a1b53d85dad7648d545ee5e0d7e768f300bfcd84.zip
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>
-rw-r--r--src/cmd/go/alldocs.go8
-rw-r--r--src/cmd/go/internal/list/list.go8
-rw-r--r--src/cmd/go/internal/load/pkg.go6
3 files changed, 15 insertions, 7 deletions
diff --git a/src/cmd/go/alldocs.go b/src/cmd/go/alldocs.go
index 0645780966b..49d390297cd 100644
--- a/src/cmd/go/alldocs.go
+++ b/src/cmd/go/alldocs.go
@@ -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
diff --git a/src/cmd/go/internal/list/list.go b/src/cmd/go/internal/list/list.go
index 975b02252e9..b4d82d9f8cc 100644
--- a/src/cmd/go/internal/list/list.go
+++ b/src/cmd/go/internal/list/list.go
@@ -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
diff --git a/src/cmd/go/internal/load/pkg.go b/src/cmd/go/internal/load/pkg.go
index 3f679271111..3a274a3ad13 100644
--- a/src/cmd/go/internal/load/pkg.go
+++ b/src/cmd/go/internal/load/pkg.go
@@ -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.