From 0cf8ab65b259bb6f9272915264ab56936bdca613 Mon Sep 17 00:00:00 2001 From: Brad Garcia Date: Fri, 21 Feb 2014 19:51:15 -0500 Subject: [PATCH] godoc: identifiers can contain underscores, not spaces. Fixes golang/go#7382. R=bradfitz, sameer CC=golang-codereviews https://golang.org/cl/67090043 --- godoc/index.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/godoc/index.go b/godoc/index.go index d3d5eaeeb5..eb5182de61 100644 --- a/godoc/index.go +++ b/godoc/index.go @@ -1201,7 +1201,7 @@ func (x *Index) lookupWord(w string) (match *LookupResult, alt *AltWords) { // isIdentifier reports whether s is a Go identifier. func isIdentifier(s string) bool { for i, ch := range s { - if unicode.IsLetter(ch) || ch == ' ' || i > 0 && unicode.IsDigit(ch) { + if unicode.IsLetter(ch) || ch == '_' || i > 0 && unicode.IsDigit(ch) { continue } return false