1
0
mirror of https://github.com/golang/go synced 2024-11-25 14:07:56 -07:00

Trim space on input to make searching more robust.

R=rsc, r, gri
CC=golang-dev
https://golang.org/cl/186255
This commit is contained in:
Christopher Wedgwood 2010-01-22 14:26:15 +11:00 committed by Rob Pike
parent cd47c903e2
commit 2a57a5c9c7

View File

@ -1157,7 +1157,7 @@ type SearchResult struct {
} }
func search(c *http.Conn, r *http.Request) { func search(c *http.Conn, r *http.Request) {
query := r.FormValue("q") query := strings.TrimSpace(r.FormValue("q"))
var result SearchResult var result SearchResult
if index, timestamp := searchIndex.get(); index != nil { if index, timestamp := searchIndex.get(); index != nil {