Skip to content
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: `go mod -init` fails inside GOPATH but behind the symlink #26217

Closed
doroginin opened this issue Jul 4, 2018 · 2 comments

Comments

Projects
None yet
4 participants
@doroginin
Copy link
Contributor

commented Jul 4, 2018

What version of Go are you using (go version)?

go version go1.10.3 linux/amd64 vgo:2018-02-20.1
  • latest vgo:
~/go/src/golang.org/x/vgo$ git log -1
commit 6cd5a417451d8ee907692eded07ef1b6b53825b1 (HEAD -> master, origin/master, origin/HEAD)
Author: Bryan C. Mills <bcmills@google.com>
Date:   Mon Jul 2 16:43:34 2018 -0400

    cmd/go/internal/modcmd: use the correct path in verifyMod

    Fixes golang/go#26151.

    Change-Id: Ibeefb1fad063bbec4085284cee39ee337a37d22d
    Reviewed-on: https://go-review.googlesource.com/121975
    Reviewed-by: Russ Cox <rsc@golang.org>

Does this issue reproduce with the latest release?

Yes, i use last release

What did you do?

mkdir -p /tmp/go/
export GOPATH=/tmp/go
ln -s /tmp/go /tmp/dev
mkdir -p /tmp/dev/src/github.com/doroginin/myproject
cd /tmp/dev/src/github.com/doroginin/myproject
vgo mod -init

What did you expect to see?

vgo: creating new go.mod: module github.com/doroginin/myproject

What did you see instead?

vgo: cannot determine module path for source directory /tmp/dev/github.com/doroginin/myproject (outside GOPATH, no import comments)

@gopherbot

This comment has been minimized.

Copy link

commented Jul 4, 2018

Change https://golang.org/cl/122216 mentions this issue: cmd/go/internal/vgo/init.go: fix FindModulePath in case of symlinks

@rsc rsc modified the milestones: vgo, Go1.11 Jul 12, 2018

@rsc rsc added the modules label Jul 12, 2018

@rsc rsc changed the title x/vgo: `vgo mod -init` fails inside GOPATH but behind the symlink cmd/go: `go mod -init` fails inside GOPATH but behind the symlink Jul 12, 2018

@gopherbot

This comment has been minimized.

Copy link

commented Jul 13, 2018

Change https://golang.org/cl/123755 mentions this issue: cmd/go/internal/modload: more aggressive symlink analysis in FindModulePath

@gopherbot gopherbot closed this in 05e02d7 Jul 13, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.