Commit 6cdf0a1e authored by Robert Griesemer's avatar Robert Griesemer

godoc: don't print spurious suggestion when running "go doc foo"

Fixes #3041.

R=rsc
CC=golang-dev
https://golang.org/cl/5671087
parent f7ce57b1
......@@ -417,11 +417,13 @@ func main() {
info = pkgHandler.getPageInfo(abspath, relpath, "", mode)
}
// second, try as command
// second, try as command unless the path is absolute
// (the go command invokes godoc w/ absolute paths; don't override)
var cinfo PageInfo
if !filepath.IsAbs(path) {
abspath = absolutePath(path, cmdHandler.fsRoot)
cinfo = cmdHandler.getPageInfo(abspath, relpath, "", mode)
}
cinfo := cmdHandler.getPageInfo(abspath, relpath, "", mode)
// determine what to use
if info.IsEmpty() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment