Closed markbates closed 6 years ago
I didn't try to reproduce this, because even if I could it's hard to test a fix. But this error is the same error as I saw in gobuffalo/pop#109 and as you saw in gobuffalo/pop#110 (github.com/mattn/anko/core not existing in mattn/anko@d5441ca3f0c7), so I'm fairly confident it's the same as those.
To recap, the problem is that vgo grabs gobuffalo/pop, finds a Gopkg.lock, and assumes it is a correct statement of the versions it should use. In this case, it appears that gobuffalo/pop has specified the wrong version of mattn/anko. Because dep is so aggressive about updating beyond what's in the lock file, no one noticed. But if you tell dep "no really I want to use what's in the lock file", it too will break:
$ cd $GOPATH/src/github.com/gobuffalo
$ git clone https://github.com/gobuffalo/pop
Cloning into 'pop'...
remote: Counting objects: 5500, done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 5500 (delta 6), reused 12 (delta 5), pack-reused 5481
Receiving objects: 100% (5500/5500), 4.47 MiB | 13.12 MiB/s, done.
Resolving deltas: 100% (3129/3129), done.
$ cd pop
$ dep ensure -vendor-only
$ go build
# github.com/gobuffalo/pop/fizz
fizz/bubbler.go:31:30: cannot use "github.com/gobuffalo/pop/vendor/github.com/mattn/anko/vm".NewEnv() (type *"github.com/gobuffalo/pop/vendor/github.com/mattn/anko/vm".Env) as type *"github.com/mattn/anko/vm".Env in argument to core.Import
$
There are two possible ways forward. The simplest is just to fix the Gopkg.lock. I sent you https://github.com/gobuffalo/pop/pull/111 to do that. If you merge that change and get it into the docker environment, then I think your example here will start working.
The next step would be to publish a go.mod in the repo too, but that's not necessary to make vgo start working for users.
Haven't tried inside docker yet (my docker daemon is apparently ill) but running these commands by hand, they work after gobuffalo/pop#111.
I'm re-opening this issue as with 1.11-tip
, Go modules still do not work correctly with Buffalo.
Reproducible
Dockerfile
Related to #1074 /cc @rsc