cmd/go: use RawToken to parse remote package metadata

CL 14315 broke the tests for parsing loosely formed remote package
metadata. Switch the parsing to use RawToken to recover the previous
behaviour that Token provided.

It could be argued that the parser should be stricter, but as remote
metadata has been readable with the parser for several years, it is
safer to change the parser to continue to accept the samples provided
in the test cases.

Change-Id: I2a3ba1757d3cff53b1a1c4386276955bb46cf8cd
Reviewed-on: https://go-review.googlesource.com/14482
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Minux Ma <minux@golang.org>
Reviewed-by: Andrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Dave Cheney 2015-09-10 15:50:47 +10:00 committed by Minux Ma
parent bab01a0b4b
commit 81a4bbffbf
1 changed files with 1 additions and 1 deletions

View File

@ -41,7 +41,7 @@ func parseMetaGoImports(r io.Reader) (imports []metaImport, err error) {
d.Strict = false
var t xml.Token
for {
t, err = d.Token()
t, err = d.RawToken()
if err != nil {
if err == io.EOF {
err = nil