1
0
mirror of https://github.com/golang/go synced 2024-11-18 13:24:39 -07:00

go/vcs: workaround EOF bug in token-based XML decoder

...using same logic as in $GOROOT/go/src/cmd/go/discovery.go

See issue #13757

Change-Id: I2ace0abed0743f4a8675fa8780e190d640b57e6c
Reviewed-on: https://go-review.googlesource.com/18196
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Alan Donovan 2015-12-28 16:51:30 -05:00
parent 157f8abbbd
commit a09dffbb6c

View File

@ -36,7 +36,7 @@ func parseMetaGoImports(r io.Reader) (imports []metaImport, err error) {
for { for {
t, err = d.Token() t, err = d.Token()
if err != nil { if err != nil {
if err == io.EOF { if err == io.EOF || len(imports) > 0 {
err = nil err = nil
} }
return return