• Rob Pike's avatar
    cmd/doc: show documentation for interface methods when requested explicitly · 2ee82edf
    Rob Pike authored
    For historical reasons, the go/doc package does not include
    the methods within an interface as part of the documented
    methods for that type. Thus,
    
    	go doc ast.Node.Pos
    
    gives an incorrect and confusing error message:
    
    	doc: no method Node.Pos in package go/ast
    
    This CL does some dirty work to dig down to the methods
    so interface methods now present their documentation:
    
    % go doc ast.node.pos
    func Pos() token.Pos  // position of first character belonging to the node
    %
    
    It must largely sidestep the doc package to do this, which
    is a shame. Perhaps things will improve there one day.
    
    The change does not handle embeddings, and in principle the
    same approach could be done for struct fields, but that is also
    not here yet. But this CL fixes the thing that was bugging me.
    
    Change-Id: Ic10a91936da96f54ee0b2f4a4fe4a8c9b93a5b4a
    Reviewed-on: https://go-review.googlesource.com/31852Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
    2ee82edf
Name
Last commit
Last update
..
addr2line Loading commit data...
api Loading commit data...
asm Loading commit data...
cgo Loading commit data...
compile Loading commit data...
cover Loading commit data...
dist Loading commit data...
doc Loading commit data...
fix Loading commit data...
go Loading commit data...
gofmt Loading commit data...
internal Loading commit data...
link Loading commit data...
nm Loading commit data...
objdump Loading commit data...
pack Loading commit data...
pprof Loading commit data...
trace Loading commit data...
vendor Loading commit data...
vet Loading commit data...