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: vgo get -u fails if the current directory contains no Go files #24486

Closed
eliasnaur opened this issue Mar 22, 2018 · 2 comments

Comments

@eliasnaur
Copy link
Contributor

commented Mar 22, 2018

$ mkdir vgoempty
$ cd vgoempty
$ cat > go.mod 
module "vgoempty"

require (
	"github.com/BurntSushi/xgb" v0.0.0-20160522160000-3abbe7f74b5f
)
$ vgo get -u
vgo: finding github.com/BurntSushi/xgb latest
vgo: import "testmod" [/home/elias/vgoempty]: no Go source files
$ cat go.mod
module "testmod"

require (
	"github.com/BurntSushi/xgb" v0.0.0-20160522160000-3abbe7f74b5f
)

I had expected no error about missing Go source files, and that the dependency was updated. If I add a dummy file, the dependency is updated as expected:

$ cat > blah.go
package vgoempty
$ vgo get -u
vgo: finding github.com/BurntSushi/xgb latest
$ cat go.mod
module "vgoempty"

require (
	"github.com/BurntSushi/xgb" v0.0.0-20160522181843-27f122750802
)

@eliasnaur eliasnaur added this to the vgo milestone Mar 22, 2018

@rsc

This comment has been minimized.

Copy link
Contributor

commented Mar 30, 2018

The overloading of get to mean "operate on the current module", "fetch a module", and "build a package" is unfortunate. We need to design this a bit better. Known issue, but I'll leave this open to track.

@rsc rsc added the NeedsDecision label Mar 30, 2018

@gopherbot

This comment has been minimized.

Copy link

commented Jul 6, 2018

Change https://golang.org/cl/122396 mentions this issue: cmd/go/internal/get: complete implementation

@golang golang locked and limited conversation to collaborators Jul 12, 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.