mirror of
https://github.com/golang/go
synced 2024-11-18 05:04:47 -07:00
godoc: correctly parse packages with digits in the package name
Fixes golang/go#26514 Change-Id: I4540737425c225c0f0c6104b5b3524621d2b0c6f GitHub-Last-Rev: 9d5fefb6ed31579b723293c7f43fcf677ac4cddb GitHub-Pull-Request: golang/tools#41 Reviewed-on: https://go-review.googlesource.com/125335 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
99195f4d4f
commit
60ffea201e
@ -132,7 +132,7 @@ func parseRow(s string) (vr versionedRow, ok bool) {
|
||||
return
|
||||
}
|
||||
rest := s[len("pkg "):]
|
||||
endPkg := strings.IndexFunc(rest, func(r rune) bool { return !(unicode.IsLetter(r) || r == '/') })
|
||||
endPkg := strings.IndexFunc(rest, func(r rune) bool { return !(unicode.IsLetter(r) || r == '/' || unicode.IsDigit(r)) })
|
||||
if endPkg == -1 {
|
||||
return
|
||||
}
|
||||
|
@ -51,6 +51,15 @@ func TestParseVersionRow(t *testing.T) {
|
||||
name: "FileInfoHeader",
|
||||
},
|
||||
},
|
||||
{
|
||||
row: "pkg encoding/base32, method (Encoding) WithPadding(int32) *Encoding",
|
||||
want: versionedRow{
|
||||
pkg: "encoding/base32",
|
||||
kind: "method",
|
||||
name: "WithPadding",
|
||||
recv: "Encoding",
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for i, tt := range tests {
|
||||
|
Loading…
Reference in New Issue
Block a user