mdempsky/unconvert

internal error importing packages when built with Go 1.14

dmitshur opened this issue · 0 comments

To reproduce:

$ go version
go version go1.14 darwin/amd64
$ export GO111MODULE=on
$ export GOPATH=$(mktemp -d)
$ go get github.com/mdempsky/unconvert
go: downloading github.com/mdempsky/unconvert v0.0.0-20190921185256-3ecd357795af
go: github.com/mdempsky/unconvert upgrade => v0.0.0-20190921185256-3ecd357795af
go: downloading golang.org/x/text v0.3.0
go: downloading golang.org/x/tools v0.0.0-20190325161752-5a8dccf5b48a
$ $(go env GOPATH)/bin/unconvert fmt
2020/02/26 08:52:23 internal error: nil Pkg importing "errors" from "fmt [fmt.test]"
2020/02/26 08:52:23 internal error: nil Pkg importing "errors" from "fmt"

The problem seems to be an old version of x/tools module. Updating it fixes it. I'll send a PR.

Edit: The underlying issue was golang/go#33554. /cc @hyangah @matloob