A
A
abrasum2016-08-02 11:34:36
JavaScript
abrasum, 2016-08-02 11:34:36

How to switch to another version of go?

Hello.
There is a linux server
On it the application on go is spinning.
The current version of go is 1.3.
Go is installed globally on the system.
I want to upgrade to version 1.6
But...
If the new version doesn't work for some reason, I want to QUICKLY ROLL BACK to the previous version.
I downloaded the archive with the latest version of go and tried to somehow start from it by conjuring with the GOROOT variable, but all the time I came across that the application could not import packages.
Something is wrong with the paths. What is the best way to migrate to the new version of go?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Dmitry Belyaev, 2016-03-23
@eellazy

you have a jquery plugin connected before jquery itself,
swap the first 2 script tags

A
Alexander Pavlyuk, 2016-08-02
@pav5000

Why do you need go on the server? Deploy there already assembled binaries and there are no problems.
Build the applicuhi binary on go 1.3 and on go 1.6. If it doesn't work with 1.6, just run the old binary with 1.3.

F
fastpars, 2016-08-02
@fastpars

If "to try" then it is enough to kill the global variables GOROOT and GOPATH.
Therefore, "to try" you can run all commands like this $GOROOT/bin/go version or kill the global PATH variable by adding $GOROOT/bin there.
Example:

export GOROOT=$HOME/lab/go/go
export GOPATH=$HOME/lab/go/gopath
export PATH=$GOROOT/bin:$GOPATH/bin:$PATH

To roll back, just reopen the terminal.
Also there is a variant through gvm
Alexander Pavlyuk is right. There is no need to keep go on the server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question