]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: use RawToken to parse remote package metadata
authorDave Cheney <dave@cheney.net>
Thu, 10 Sep 2015 05:50:47 +0000 (15:50 +1000)
committerMinux Ma <minux@golang.org>
Thu, 10 Sep 2015 07:30:43 +0000 (07:30 +0000)
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>

src/cmd/go/discovery.go

index b9f42799546e306f8f3762d00d2c6d273d3e50a2..4d1df2f4726dc039bb829d5ae3a5fff7b148a150 100644 (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