-
Notifications
You must be signed in to change notification settings - Fork 18k
pre-modules go get
replacement needed, as it won't work outside of existsing module with modules enabled
#27380
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
Comments
Simply upgrading to 1.11 does not cause this issue. Explicitly setting In any case, this is a duplicate of #24250. |
I have come up with what is a partial solution. It is a shell script which simulates the The contents of I use an alias to save me even more keystrokes, |
Translation into tmpDir=`mktemp`
cd $tmpDir
go mod init tmp/for/tool
go get $1 It creates temporary directory, cd into it, initializes a module within, perform |
The "workaround" is very simple: set |
is harder than
|
So, I am currently using official build (that tgz file) for Linux with export GO111MODULE=on. And I am having troubles building binaries in a old way outside of any existing module:
As you see, I am trying to download and build goimports and then put the binary into $GOPATH/bin with this go get call. Thus, we are having obvious usability downgrade. Everything is OK when I do this inside some existing module, BTW.
I believe there should be some kind of replacement. It is clear go get is not the best place for this sort of functionality after go modules enabled. I guess there should be a new command specially for this case.
The text was updated successfully, but these errors were encountered: