aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Souza <franciscossouza@gmail.com>2012-03-13 09:08:04 +1100
committerAndrew Gerrand <adg@golang.org>2012-03-13 09:08:04 +1100
commitbb6e685b7b7cc2a9ba7f81b98fa29bfdbf5cff7b (patch)
tree385ffa74891a2209aae75c165e2feeb88c7060e2
parent60b98d62087d582dafdda68c2af281c5e204fe03 (diff)
downloadgo-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.go4
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)