mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
godoc: support for multiple packages in a directory
- smartly select the "right" package - provide a list of other packages R=rsc CC=golang-dev https://golang.org/cl/466042
This commit is contained in:
parent
1a5cd2c0e1
commit
226c2ec256
4 changed files with 80 additions and 27 deletions
|
|
@ -241,14 +241,16 @@ func main() {
|
|||
relpath = relativePath(path)
|
||||
}
|
||||
|
||||
info := pkgHandler.getPageInfo(abspath, relpath, *genAST, true)
|
||||
// TODO(gri): Provide a mechanism (flag?) to select a package
|
||||
// if there are multiple packages in a directory.
|
||||
info := pkgHandler.getPageInfo(abspath, relpath, "", *genAST, true)
|
||||
|
||||
if info.PAst == nil && info.PDoc == nil && info.Dirs == nil {
|
||||
// try again, this time assume it's a command
|
||||
if len(path) > 0 && path[0] != '/' {
|
||||
abspath = absolutePath(path, cmdHandler.fsRoot)
|
||||
}
|
||||
info = cmdHandler.getPageInfo(abspath, relpath, false, false)
|
||||
info = cmdHandler.getPageInfo(abspath, relpath, "", false, false)
|
||||
}
|
||||
|
||||
if info.PDoc != nil && flag.NArg() > 1 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue