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: default view does not show methods #28906
Comments
/cc @robpike as per https://dev.golang.org/owners/. There's It's also interesting that its help line is |
+1, I find the default /cc @dmitshur |
This was done intentionally in the design of go doc to avoid dumping too much. The default view shows you the top-level names in the package and then you can ask for lower things. I find it nice that go doc crypto/tls fits on one screen. If you want to know about the Conn methods, use go doc crypto/tls.Conn (or just go doc tls.Conn). Given that go doc has had this design for quite a few releases, we're not going to change it now. |
@rsc I can understand your reasoning. Would it be possible to at least give the user a hint that there are methods not shown? For example, in the github.com/patrickmn/go-cache library, there are dozens of methods. The default behavior is:
It would be useful if go doc mentioned that there are methods. For example:
|
If I run
go doc strings
, it shows exported functions but not methods:go doc strings
OutputThere is no indication that (for example) Builder has a bunch of unexported methods.
In the package summaries on
godoc.org
andgolang.org/pkg
pages, exported methods are shown (but, likego doc
, fields, constants and variables are omitted).Perhaps
go doc
should use the same heuristics asgodoc.org
and include exported methods too.The text was updated successfully, but these errors were encountered: