• Russ Cox's avatar
    cmd/doc: adapt directory search for modules · b7d3f4c0
    Russ Cox authored
    Previously, cmd/doc treated GOROOT/src and GOPATH/src
    as the roots of the directory trees holding packages, assuming
    that the import path would be the path elements after the src directory.
    
    With modules, each module serves as its own root of a file tree,
    and the import path prefix starts with the module path before
    adding the path elements after the module root.
    
    There are ways we could make this more efficient,
    but for now this is a fairly small adjustment to get 'go doc'
    working OK for modules for Go 1.11.
    
    Fixes #26635.
    
    Change-Id: Ifdee4194601312846c7b1fc67f2fe7a4a44269cc
    Reviewed-on: https://go-review.googlesource.com/126799
    Run-TryBot: Russ Cox <rsc@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarRob Pike <r@golang.org>
    b7d3f4c0
Name
Last commit
Last update
.github Loading commit data...
api Loading commit data...
doc Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...