Setting the correct GOPATH variable in golang


#1

so i updated golang:

$cd workspace

$wget https://storage.googleapis.com/golang/go1.7.3.linux-amd64.tar.gz

then

$sudo tar -C /opt -xzf go1.7.3.linux-amd64.tar.gz

and then

$ export GOROOT=$HOME/.go

$export PATH=$PATH:$GOROOT/bin

ugh, what up with this?

$ go env /// returned

warning: GOPATH set to GOROOT (/home/ubuntu/.go) has no effect
GOARCH=“amd64"
GOBIN=”“
GOEXE=”"
GOHOSTARCH=“amd64"
GOHOSTOS=“linux"
GOOS=“linux"
GOPATH=”/home/ubuntu/.go"
GORACE=”“
GOROOT=”/home/ubuntu/.go"
GOTOOLDIR=”/home/ubuntu/.go/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC=“gcc"
GOGCCFLAGS=”-fPIC -m64 -pthread -fmessage-length=0"
CXX=“g++”

If anyone would be so kind as to direct me to correct documentation regarding the repairing of my golang install (gopath env), I would be ever so grateful. In addition, proper packages config within golang would be super kewl, as well. Thank you in advance, for any and all assistance on this matter.

Regards,

M.

/// Please, disregard, issues resolved…

c9,io kicks butt!


#2

How was the issue resolved?


#3

How I got golang working fully …

After quite a big fight with the c9 default dirs conflicting with what I expected, I did the following to start working on an existing repo:

  1. Create a blank c9 workspace
  2. go get github.com/myuid/myrepo

This dropped everything into the src subdirectory of the /users/ubuntu dir in my workspace, thus revealing where I should have put stuff before; but in any case the go get’ed version now finds everything it needs to compile.

Hope this helps someone.

Andy :slight_smile: