1
0
mirror of https://github.com/golang/go synced 2024-11-05 14:56:10 -07:00

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
This commit is contained in:
Andrew Gerrand 2013-10-11 10:36:50 +09:00
parent ce4c627192
commit 7b481db506

View File

@ -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