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: add -src flag #18807

adg opened this issue Jan 26, 2017 · 2 comments

cmd/doc: add -src flag #18807

adg opened this issue Jan 26, 2017 · 2 comments


Copy link

adg commented Jan 26, 2017

The godoc command has a -src flag that prints the source of the specified identifier.

It would be great if the doc tool had this feature, too, so that one could do this:

$ go doc -src io.readfull
// ReadFull reads exactly len(buf) bytes from r into buf.
// It returns the number of bytes copied and an error if fewer bytes were read.
// The error is EOF only if no bytes were read.
// If an EOF happens after reading some but not all the bytes,
// ReadFull returns ErrUnexpectedEOF.
// On return, n == len(buf) if and only if err == nil.
func ReadFull(r Reader, buf []byte) (n int, err error) {
    return ReadAtLeast(r, buf, len(buf))
@adg adg added this to the Unplanned milestone Jan 26, 2017
Copy link
Contributor Author

adg commented Jan 26, 2017

cc @robpike

Copy link

Change mentions this issue: cmd/doc: add a -src flag to show original source

@golang golang locked and limited conversation to collaborators Oct 10, 2019
@rsc rsc unassigned robpike Jun 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
None yet

No branches or pull requests

3 participants