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

x/vgo: print auto-guessed module setting during go.mod init #23978

Closed
davecheney opened this issue Feb 21, 2018 · 2 comments

Comments

@davecheney
Copy link
Contributor

commented Feb 21, 2018

Please answer these questions before submitting your issue. Thanks!

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

go 1.10

Does this issue reproduce with the latest release?

n/a

What operating system and processor architecture are you using (go env)?

darwin/amd64

What did you do?

I'm trying vgo on heptio/contour, a moderate project which depends on the kubernetes client-go library. My $GOPATH is set to $HOME

Daves-MacBook-Pro(~/src/github.com/heptio/contour) % echo > go.mod
Daves-MacBook-Pro(~/src/github.com/heptio/contour) % vgo build
vgo: import "github.com/davecheney/contour" [/Users/dfc/src/github.com/heptio/contour]: no Go source files

What did you expect to see?

Daves-MacBook-Pro(~/src/github.com/heptio/contour) % cat go.mod 
module "github.com/heptio/contour"

What did you see instead?

Daves-MacBook-Pro(~/src/github.com/heptio/contour) % cat go.mod 
module "github.com/davecheney/contour"

This may be because I have renamed my origin branch to be my fork of contour

Daves-MacBook-Pro(~/src/github.com/heptio/contour) % git remote  -v
origin  git@github.com:davecheney/contour.git (fetch)
origin  git@github.com:davecheney/contour.git (push)
upstream        git@github.com:heptio/contour.git (fetch)
upstream        git@github.com:heptio/contour.git (push)

@gopherbot gopherbot modified the milestones: Unreleased, vgo Feb 21, 2018

@rsc

This comment has been minimized.

Copy link
Contributor

commented Apr 2, 2018

The auto-detection is not perfect. Probably it should print what it chose, so that if it's wrong maybe you avoid a debugging session. You can always write the module line yourself.

@rsc rsc changed the title x/vgo: vgo build with empty go.mod file picked up the wrong module root x/vgo: print auto-detected module line during go.mod init Apr 2, 2018

@rsc rsc changed the title x/vgo: print auto-detected module line during go.mod init x/vgo: print auto-guessed module setting during go.mod init Apr 2, 2018

@rsc rsc added the NeedsFix label Apr 2, 2018

@gopherbot

This comment has been minimized.

Copy link

commented May 22, 2018

Change https://golang.org/cl/114155 mentions this issue: cmd/go/internal/vgo: print auto-guessed module setting during go.mod init

@golang golang locked and limited conversation to collaborators May 24, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.