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 {