From: Robert Griesemer Date: Fri, 17 Feb 2012 19:01:16 +0000 (-0800) Subject: godoc: don't print spurious suggestion when running "go doc foo" X-Git-Tag: weekly.2012-02-22~147 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=6cdf0a1eab8c038b439543f45aff2bcf660b0eac;p=gostls13.git godoc: don't print spurious suggestion when running "go doc foo" Fixes #3041. R=rsc CC=golang-dev https://golang.org/cl/5671087 --- diff --git a/src/cmd/godoc/main.go b/src/cmd/godoc/main.go index e5e81c6dfa..96b729978f 100644 --- a/src/cmd/godoc/main.go +++ b/src/cmd/godoc/main.go @@ -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() {