From: Francisco Souza Date: Mon, 12 Mar 2012 22:08:04 +0000 (+1100) Subject: godoc: fix codewalk handler X-Git-Tag: weekly.2012-03-13~23 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=bb6e685b7b7cc2a9ba7f81b98fa29bfdbf5cff7b;p=gostls13.git 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 --- 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)