A
A
Alexey Yarkov2016-07-24 22:26:26
go
Alexey Yarkov, 2016-07-24 22:26:26

What is wrong with me or how to install golang in ubuntu?

I downloaded the archive and unpacked it in ~/go : I registered variables
$ tar -C ~/ -xzf go1.6.3.linux-amd64.tar.gz
in ~/.bashrc and ~/.profile :

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

I try to install lib:
$ go get github.com/Philio/GoMySQL
And I get this:
warning: GOPATH set to GOROOT (/home/user/go) has no effect
package github.com/Philio/GoMySQL: cannot download, $GOPATH must not be set to $GOROOT. For more details see: go help gopath

I see that the problem is in the coincidence of GOPATH and GOROOT, but the command go help gopathdid not help.
Here is the output of go env :
warning: GOPATH set to GOROOT (/home/user/go) has no effect
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/user/go"
GORACE=""
GOROOT="/home/user/go"
GOTOOLDIR="/home/user/go/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"

Tell me what's wrong. I'm already bored...

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xotkot, 2016-07-24
@yarkov

in order to be able to use "go get ..." and " go insatall ... " the GOBIN variable must be set:

$ mkdir -p $GOPATH/bin
$ export GOBIN=$GOPATH/bin

ps
one is enough

V
Vladimir Grabko, 2016-07-25
@VGrabko

you need to install git and gcc

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question