-
Notifications
You must be signed in to change notification settings - Fork 525
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
How can i use my own GOPATH default? #277
Comments
Why the GVM PKGSET modify my system GOPATH ? |
why export so many same var like : export PATH; PATH="/Users/xiuyuhang/.gvm/pkgsets/go1.9/go-pj/bin:${GVM_OVERLAY_PREFIX}/bin:${PATH}" so chaotic isnt it?? |
I'm having this same issue and I was wondering if there was any solution to fixing this problem? |
I really dont know ... This issue does not have anybody to attention |
In my You can do something similar to set it to your expected GOPATH, just make sure put the line after so your setting will override GVM's. |
You can fix this on a version-by-version basis using I really wish there was an option in GVM to not use version-specific GOPATHs. |
Look at |
I tried adding EDIT - scratch that. I just figured out the error but don't exactly know why it was happening. My ~/.bashrc had the following:
I changed the last line to: TLDR; My updated, working
|
Edit |
@adam-hanna you don't need to set And as previously stated, the proper way to define a consistent singular GOPATH is to us |
@kaedys I edited the file because I could not get EG:
after reloading the shell, gvm was not setting my default The use case, just so you have context, installing some user tool, like |
You have to edit the pkgenv before you set default, because the
Now it will use your pkgenv changes on reload. |
@kaedys thanks for the tip, that worked but what if you have to change it again later on? |
@pecigonzalo Simply edit the pkgenv for the relevant version (in this case, While it's intuitive to think of |
Makes sense, thanks a lot for the explanation. Maybe it would be good to add this to the Wiki |
How do you use the |
Literally just type
|
شكرا |
I change all GOPATH in gvm environment files and It fixed. |
I was able to achieve a desirable result using sym-linking
|
Not even slightly helpful. Read the thread maybe? The issue is that GVM automatically configures itself with version-specific GOPATHs, despite a single global GOPATH being a common (I suspect majority) use case. The question was how to configure GVM to use one's already-configured global GOPATH (or That all said, with the advent of modules, GOPATH is really nothing more than a base location for determining the bin (target of So the TL;DR for this is, use module mode. If you absolutely must use non-module mode, you'll have to update the GOPATH definition using |
Edit GOPATH of the file (/.gvm/environments/default and same level config) , then |
Duh, that's in the documentation. The problem is that you have to do that again for every new version of Go you install using GVM. The ask is for some way to tell newly installed versions, newly created pkgenvs, to use a specific fixed GOPATH instead of GVM always trying to segregate GOPATHs between versions. That hasn't been needed for years, and definitely isn't needed in the world of Go modules, since literally the only purpose of the GOPATH now is for your GOBIN (which is independent of your installed Go version) and your module cache, which the Go tooling already handles natively because its version-aware when it comes to dependency models. Like, GVM could entirely omit the GOPATH set, and just leave it as whatever the user had previously set, or the default As it stands, if you install a new Go version using GVM and forget to update the pkgenv, it will force you to redownload your entire module cache, and then also reinstall any tools to your (new) GOBIN that you've downloaded (or locally installed) using |
everytime i login my zsh. my GOPATH is /.../.gvm/pkgsets/go1.9/global.
The text was updated successfully, but these errors were encountered: