From 2a57a5c9c772345687ca8b35496f27754678eb11 Mon Sep 17 00:00:00 2001 From: Christopher Wedgwood Date: Fri, 22 Jan 2010 14:26:15 +1100 Subject: [PATCH] Trim space on input to make searching more robust. R=rsc, r, gri CC=golang-dev https://golang.org/cl/186255 --- src/cmd/godoc/godoc.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cmd/godoc/godoc.go b/src/cmd/godoc/godoc.go index 7a8a8d864c6..627c4027d73 100644 --- a/src/cmd/godoc/godoc.go +++ b/src/cmd/godoc/godoc.go @@ -1157,7 +1157,7 @@ type SearchResult struct { } func search(c *http.Conn, r *http.Request) { - query := r.FormValue("q") + query := strings.TrimSpace(r.FormValue("q")) var result SearchResult if index, timestamp := searchIndex.get(); index != nil {