)
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.
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'.
`,
}
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) {