From bb6e685b7b7cc2a9ba7f81b98fa29bfdbf5cff7b Mon Sep 17 00:00:00 2001 From: Francisco Souza Date: Tue, 13 Mar 2012 09:08:04 +1100 Subject: [PATCH] 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 --- src/cmd/godoc/codewalk.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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)