-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/go: vgo run|build *.go fails for module versions >=2 where module is in GOPATH #26046
Comments
@mwf is this still an issue? I don't see any problems as of 6cd5a417451d8ee907692eded07ef1b6b53825b1:
(note: the last step needing to be |
@myitcv yeap, I checked it with the same version. And there is some crazy thing about it. Compare this (failing):
Output: And this (OK):
It's weird, but it builds OK if outside of GOPATH and fails if inside. |
vgo build *.go
fails for module versions >=2
@mwf nicely tracked down. Here's a standalone repro:
gives
|
Reproduced, thanks for these great scripts @myitcv. |
Related: #25281. Both are about incorrectly guessing the import path of the current directory because it happens to be in GOPATH. |
This script works for me now (updated to use go instead of vgo).
|
@rsc I think this issue remains. The point I missed when I was when retesting a couple of days ago is that since this issue was opened we have introduced the concept of A slight tweak to the above shows the issue remains:
gives
|
Change https://golang.org/cl/129798 mentions this issue: |
What version of Go are you using (
go version
)?go version go1.10.1 darwin/amd64 vgo:2018-02-20.1
Latest
vgo
:What did you do?
Please refer to https://github.com/mwf/goplay/tree/master/vgo/hello_world
I check a case when we've got a binary with major version v2.0.0 and there is no
v2
subdirectory or branch, major version is listed ingo.mod
instead.It should be OK for
vgo
if I'm not mistaken, because you didn't want to force all go users to use a single workflow with branches or subdirectories. So we assumemaster
branch is our current stable version, tags correspond with major version set inmodule
directive.go.mod:
main.go:
vgo run .
orvgo build .
work without errors.What did you expect to see?
vgo run main.go
should run without errorsWhat did you see instead?
The text was updated successfully, but these errors were encountered: