From 7b481db5061faa008a3d0f8a79c3019ed9dbaabe Mon Sep 17 00:00:00 2001 From: Andrew Gerrand Date: Fri, 11 Oct 2013 10:36:50 +0900 Subject: [PATCH] go.tools/cmd/godoc: search go.tools/cmd for command docs Update golang/go#6527 R=r, dsymonds CC=golang-dev https://golang.org/cl/14526053 --- cmd/godoc/main.go | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cmd/godoc/main.go b/cmd/godoc/main.go index 34bb4eb01a..5237cb5727 100644 --- a/cmd/godoc/main.go +++ b/cmd/godoc/main.go @@ -56,8 +56,8 @@ import ( ) const ( - defaultAddr = ":6060" // default webserver address - templatePath = "code.google.com/p/go.tools/cmd/godoc/template" + defaultAddr = ":6060" // default webserver address + toolsPath = "code.google.com/p/go.tools/cmd/" ) var ( @@ -383,6 +383,11 @@ func main() { if !filepath.IsAbs(path) { abspath = pathpkg.Join(pres.CmdFSRoot(), path) cinfo = pres.GetCmdPageInfo(abspath, relpath, mode) + if cinfo.IsEmpty() { + // Try go.tools/cmd if not found in $GOROOT/cmd. + abspath = pathpkg.Join(pres.PkgFSRoot(), toolsPath+path) + cinfo = pres.GetCmdPageInfo(abspath, relpath, mode) + } } // determine what to use