diff --git a/godoc/cmdline.go b/godoc/cmdline.go index 86861593d..54f5f7ee7 100644 --- a/godoc/cmdline.go +++ b/godoc/cmdline.go @@ -72,8 +72,8 @@ func CommandLine(w io.Writer, fs vfs.NameSpace, pres *Presentation, args []strin abspath = pathpkg.Join(pres.PkgFSRoot(), toolsPath+path) cinfo = pres.GetCmdPageInfo(abspath, relpath, mode) if cinfo.IsEmpty() { - // Then try $GOROOT/cmd. - abspath = pathpkg.Join(pres.CmdFSRoot(), path) + // Then try $GOROOT/src/cmd. + abspath = pathpkg.Join(pres.CmdFSRoot(), cmdPrefix, path) cinfo = pres.GetCmdPageInfo(abspath, relpath, mode) } } diff --git a/godoc/cmdline_test.go b/godoc/cmdline_test.go index 8c9ce22ee..cebbf70ec 100644 --- a/godoc/cmdline_test.go +++ b/godoc/cmdline_test.go @@ -206,7 +206,7 @@ package main p: p, c: c, pattern: "/cmd/", - fsRoot: "/src/cmd", + fsRoot: "/src", } p.pkgHandler = handlerServer{ p: p,