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))
}
The text was updated successfully, but these errors were encountered:
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:The text was updated successfully, but these errors were encountered: