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/doc: ability to list packages in subdirectories #11153

Closed
hyangah opened this issue Jun 10, 2015 · 1 comment
Closed

cmd/doc: ability to list packages in subdirectories #11153

hyangah opened this issue Jun 10, 2015 · 1 comment
Milestone

Comments

@hyangah
Copy link
Contributor

hyangah commented Jun 10, 2015

Old 'godoc' web version shows the list of packages along with package synopsis (e.g. http://golang.org/pkg/compress/), which is often useful when figuring out the relationships among packages, or discovering packages. I hope the new 'doc' command provides this functionality.

One option is to list packages in the subdirectories as output of 'go doc'.

cd $GOROOT/src/compress
go doc
doc: no buildable Go source files in /Users/hakim/Local/goroots/tip/go/src/compress
exit status 1
go doc golang.org/x/mobile
doc: no such package golang.org/x/mobile
exit status 1

@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Jun 10, 2015
@rsc
Copy link
Contributor

rsc commented Nov 5, 2015

Doc is intentionally very restricted in what it prints, to keep SNR high. The goal is explicitly to not start printing anything that might be useful, like godoc does.

It's possible that if there are no Go source files in a directory, we could list the subdirectories, but I don't even think that's right: then we'd have to decide whether to print them when there is a valid package that also has subdirectories, and I think the answer that must be no. If you say 'go doc math' you are not (usually) asking about math/rand.

In this case, there is already a command for listing packages: go list, as in go list ./....

@rsc rsc closed this as completed Nov 5, 2015
@golang golang locked and limited conversation to collaborators Nov 4, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants