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
Closed

cmd/go: go mod -init fails inside GOPATH but behind the symlink #26217

doroginin opened this issue Jul 4, 2018 · 2 comments
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@doroginin
Copy link
Contributor

doroginin 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
Copy link

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

@bcmills bcmills added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label Jul 4, 2018
@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
Copy link

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

@golang golang locked and limited conversation to collaborators Jul 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants