FAQ
Is there a recommended way to work with multiple SDK versions on one
system? Would it be simply redefining GOROOT and GOPATH to point different
locations as needed? I presume that trying to use the same GOPATH across
multiple versions could result in a mess due to binary incompatibility in
the pkg and bin directories, but maybe someone has a documented approach to
dealing with this.

TIA for any suggestions/comments



--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Florin Patan at Feb 16, 2016 at 1:31 am
    In theory you need the following:
    - wipe $GOPATH/pkg every time you switch between the Go version (might not be needed in the recent versions)
    - set GOROOT for each command you run to point to the binary.

    $GOPATH/bin is not important as those are binary executable files, the output of Bo install/build so not relevant for which Go version you use.

    Hope this answers your question.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Dave Cheney at Feb 16, 2016 at 1:44 am
    It's even easier than that. Check out various versions of go into different locations,say $HOME/go1.4, $HOME/go1.5, build them as normal, then depending on which go command you invoke, it just works. You don't need to set GOROOT

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Dave Cheney at Feb 16, 2016 at 1:45 am
    This blog post is 18 months old, so the methodology for building the code has changed, but the theory is still the same.

    http://dave.cheney.net/2014/09/13/how-to-install-multiple-versions

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Adrian Sampaleanu at Feb 16, 2016 at 5:17 am
    Thanks Florin, Dave - I'll take both of your comments into consideration
    give that I am using Windows and I do install from the zip file into a
    non-standard (c:\go) location.

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Dave Cheney at Feb 16, 2016 at 6:52 am
    Hmm, in that case your options are less flexible. Compiling from source
    will give you all the flexibility that we enjoy on unix platforms, but it's
    a more complex process on windows. If you decide not to compile from source
    you will have to resort to changing %GOROOT% when you want to switch
    toolchains, and the possibility of getting that out of sync is likely.

    My recommendation would be to unpack the zip files into C:\, say c:\go1.5,
    c:\go 1.4, then "switching" Go versions is the same as renaming one of
    these folders to c:\go. That's going to be your most reliably method.
    On Tuesday, 16 February 2016 16:17:30 UTC+11, Adrian Sampaleanu wrote:


    Thanks Florin, Dave - I'll take both of your comments into consideration
    give that I am using Windows and I do install from the zip file into a
    non-standard (c:\go) location.
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedFeb 15, '16 at 6:34p
activeFeb 16, '16 at 6:52a
posts6
users3
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase