Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: go test all is under-documented #27547

Closed
jadekler opened this issue Sep 6, 2018 · 5 comments

Comments

Projects
None yet
4 participants
@jadekler
Copy link
Contributor

commented Sep 6, 2018

What version of Go are you using (go version)?

$ go version
go version go1.11 darwin/amd64

Issue

How do I get help for go test all? go help test all doesn't work, ditto go test help all, go help test doesn't have documentation for it, and docs [1] [2] dont mention it.

Perhaps I'm missing something - sorry if so.

1: https://github.com/golang/go/wiki/Modules#installing-and-activating-module-support
2: https://golang.org/pkg/testing/

@andybons

This comment has been minimized.

Copy link
Member

commented Sep 6, 2018

@andybons andybons changed the title test: go test all is under-documented cmd/go: go test all is under-documented Sep 6, 2018

@myitcv

This comment has been minimized.

Copy link
Member

commented Sep 7, 2018

@jadekler at the bottom of go help test you will see:

For more about specifying packages, see 'go help packages'

Within go help packages you will see:

- "all" expands to all packages found in all the GOPATH
trees. For example, 'go list all' lists all the packages on the local
system. When using modules, "all" expands to all packages in
the main module and their dependencies, including dependencies
needed by tests of any of those.

Hopefully that answers things so I'll close this issue; please shout if that's not the case.

@myitcv myitcv closed this Sep 7, 2018

@jadekler

This comment has been minimized.

Copy link
Contributor Author

commented Sep 7, 2018

Thanks for the reply @myitcv. I do not think that is sufficient, but we're close. Consider that when I type go test github.com/foo/bar, I know that I'm dealing with a package. However, if I'm moderately unaware of modules (1), go test all is cryptic. What is "all"? A bit of guessing and extrapolation arrives at the answer: all packages.

However, guesswork and extrapolation too often ends in frustration instead of enlightenment. We can cut all of that out with a greppable note that's as simple as this:

Note that 'go test all' runs tests against all packages. For more information,
see 'go help packages'.

1: Which is hopefully 90% of users! If we can make them as unobtrusive as possible. :)

@jadekler

This comment has been minimized.

Copy link
Contributor Author

commented Sep 7, 2018

@gopherbot

This comment has been minimized.

Copy link

commented Sep 7, 2018

Change https://golang.org/cl/134095 mentions this issue: cmd/test: add documentation for 'go test all'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.