1 env GO111MODULE=off
2
3 # go help shows overview.
4 go help
5 stdout 'Go is a tool'
6 stdout 'bug.*start a bug report'
7
8 # go help bug shows usage for bug
9 go help bug
10 stdout 'usage: go bug'
11 stdout 'bug report'
12
13 # go bug help is an error (bug takes no arguments)
14 ! go bug help
15 stderr 'bug takes no arguments'
16
17 # go help mod shows mod subcommands
18 go help mod
19 stdout 'go mod <command>'
20 stdout tidy
21
22 # go help mod tidy explains tidy
23 go help mod tidy
24 stdout 'usage: go mod tidy'
25
26 # go mod help tidy does too
27 go mod help tidy
28 stdout 'usage: go mod tidy'
29
30 # go mod --help doesn't print help but at least suggests it.
31 ! go mod --help
32 stderr 'Run ''go help mod'' for usage.'
33
34 # Earlier versions of Go printed the same as 'go -h' here.
35 # Also make sure we print the short help line.
36 ! go vet -h
37 stderr 'usage: go vet .*'
38 stderr 'Run ''go help vet'' for details.'
39 stderr 'Run ''go tool vet help'' for a full list of flags and analyzers.'
40 stderr 'Run ''go tool vet -help'' for an overview.'
41
42 # Earlier versions of Go printed a large document here, instead of these two
43 # lines.
44 ! go test -h
45 stderr 'usage: go test'
46 stderr 'Run ''go help test'' and ''go help testflag'' for details.'
47
48 # go help get shows usage for get
49 go help get
50 stdout 'usage: go get'
51 stdout 'get when using GOPATH'
52
View as plain text