diff options
author | Francisco Souza <franciscossouza@gmail.com> | 2012-03-13 09:08:04 +1100 |
---|---|---|
committer | Andrew Gerrand <adg@golang.org> | 2012-03-13 09:08:04 +1100 |
commit | bb6e685b7b7cc2a9ba7f81b98fa29bfdbf5cff7b (patch) | |
tree | 385ffa74891a2209aae75c165e2feeb88c7060e2 | |
parent | 60b98d62087d582dafdda68c2af281c5e204fe03 (diff) | |
download | go-bb6e685b7b7cc2a9ba7f81b98fa29bfdbf5cff7b.tar.gz go-bb6e685b7b7cc2a9ba7f81b98fa29bfdbf5cff7b.zip |
godoc: fix codewalk handler
For URLs ending with /, the handler did not work, trying to append
".xml" to the path.
For instance, the "Share Memory by Communicating" returned the
following error:
open /Users/francisco.souza/lib/go/doc/codewalk/sharemem/.xml: no such file or directory
R=adg, minux.ma
CC=golang-dev
https://golang.org/cl/5797065
-rw-r--r-- | src/cmd/godoc/codewalk.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cmd/godoc/codewalk.go b/src/cmd/godoc/codewalk.go index 2804ebbe5d..3e38162a48 100644 --- a/src/cmd/godoc/codewalk.go +++ b/src/cmd/godoc/codewalk.go @@ -53,7 +53,9 @@ func codewalk(w http.ResponseWriter, r *http.Request) { } // Otherwise append .xml and hope to find - // a codewalk description. + // a codewalk description, but before trim + // the trailing /. + abspath = strings.TrimRight(abspath, "/") cw, err := loadCodewalk(abspath + ".xml") if err != nil { log.Print(err) |