Commit 81a4bbff authored by Dave Cheney's avatar Dave Cheney Committed by Minux Ma

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/14482Reviewed-by: 's avatarMinux Ma <minux@golang.org>
Run-TryBot: Minux Ma <minux@golang.org>
Reviewed-by: 's avatarAndrew Gerrand <adg@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent bab01a0b
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment