]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: add documentation for test and xtest fields output by go list
authorMichael Matloob <matloob@golang.org>
Sat, 16 Jan 2021 00:41:26 +0000 (19:41 -0500)
committerMichael Matloob <matloob@golang.org>
Fri, 22 Jan 2021 18:51:44 +0000 (18:51 +0000)
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>
src/cmd/go/alldocs.go
src/cmd/go/internal/list/list.go
src/cmd/go/internal/load/pkg.go

index 0645780966b2834f0025f9cb6317aaca4b5d4b87..49d390297cdc508135437283e4670e9824c86cd4 100644 (file)
 //         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
index 975b02252e9609ad08ba6a447c141e019b0791ee..b4d82d9f8ccc97cb4e9400b15774958d4b4ce921 100644 (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
index 3f67927111123fb479199684bf5e0066eab3108d..3a274a3ad13f61f7514c98073a8d1c7c89d360b5 100644 (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.