summaryrefslogtreecommitdiff
path: root/src/cmd/go/list.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/go/list.go')
-rw-r--r--src/cmd/go/list.go17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/cmd/go/list.go b/src/cmd/go/list.go
index 2d23d077e..f56ebed38 100644
--- a/src/cmd/go/list.go
+++ b/src/cmd/go/list.go
@@ -14,7 +14,7 @@ import (
)
var cmdList = &Command{
- UsageLine: "list [-e] [-f format] [-json] [-tags 'tag list'] [packages]",
+ UsageLine: "list [-e] [-race] [-f format] [-json] [-tags 'tag list'] [packages]",
Short: "list packages",
Long: `
List lists the packages named by the import paths, one per line.
@@ -46,14 +46,17 @@ which calls strings.Join. The struct being passed to the template is:
CgoFiles []string // .go sources files that import "C"
IgnoredGoFiles []string // .go sources ignored due to build constraints
CFiles []string // .c source files
- HFiles []string // .h source files
+ CXXFiles []string // .cc, .cxx and .cpp source files
+ HFiles []string // .h, .hh, .hpp and .hxx source files
SFiles []string // .s source files
- SysoFiles []string // .syso object files to add to archive
SwigFiles []string // .swig files
SwigCXXFiles []string // .swigcxx files
+ SysoFiles []string // .syso object files to add to archive
// Cgo directives
CgoCFLAGS []string // cgo: flags for C compiler
+ CgoCPPFLAGS []string // cgo: flags for C preprocessor
+ CgoCXXFLAGS []string // cgo: flags for C++ compiler
CgoLDFLAGS []string // cgo: flags for linker
CgoPkgConfig []string // cgo: pkg-config names
@@ -88,6 +91,9 @@ a non-nil Error field; other information may or may not be missing
The -tags flag specifies a list of build tags, like in the 'go build'
command.
+The -race flag causes the package data to include the dependencies
+required by the race detector.
+
For more about specifying packages, see 'go help packages'.
`,
}
@@ -101,12 +107,17 @@ func init() {
var listE = cmdList.Flag.Bool("e", false, "")
var listFmt = cmdList.Flag.String("f", "{{.ImportPath}}", "")
var listJson = cmdList.Flag.Bool("json", false, "")
+var listRace = cmdList.Flag.Bool("race", false, "")
var nl = []byte{'\n'}
func runList(cmd *Command, args []string) {
out := newTrackingWriter(os.Stdout)
defer out.w.Flush()
+ if *listRace {
+ buildRace = true
+ }
+
var do func(*Package)
if *listJson {
do = func(p *Package) {