How to confirm that $GOPATH and $GOROOT are properly set?

Viewed 28096

This is not a repeat of this question:

what should be the values of GOPATH and GOROOT?

I don't want to know what the values should be. I want to know what I should see when I type ls $GOROOT or ls $GOPATH into console. I'm pretty sure I set things up wrong following a tutorial almost a year ago, and I want to be able to confirm that these two are pointing to where they should be by simply checking that what they point to looks right.

Here's where I am right now. It looks like $GOROOT is pointing nowhere. I'm pretty sure it should be pointing at usr/local/go, but it would be a lot easier to confirm if I knew what the expected result of ls $GOROOT is supposed to be.

As for $GOPATH I'm not totally sure if my "workspace" is where all my go code is, or maybe just the github stuff, or maybe the particular folder I'm working within. I know it's supposed to point to my "work space," but I don't know what that work space I'm looking for looks like.

Sephs-MBP:ThumbzArt seph$ $GOROOT
Sephs-MBP:ThumbzArt seph$ $GOPATH
-bash: /Users/seph/code/golang: is a directory
Sephs-MBP:ThumbzArt seph$ ls $GOROOT
Bman.jpg            README.md           ThumbzArt.sublime-workspacescripts              thumbzart.go
LICENSE.md          ThumbzArt.sublime-project   public              templates           ticktock.go
Sephs-MBP:ThumbzArt seph$ $GOPATH
-bash: /Users/seph/code/golang: is a directory
Sephs-MBP:ThumbzArt seph$ ls $GOPATH
-   bin p   pkg src
Sephs-MBP:ThumbzArt seph$ ls /usr/local/go
AUTHORS     CONTRIBUTORS    PATENTS     VERSION     bin     doc     lib     pkg     src
CONTRIBUTING.md LICENSE     README.md   api     blog        favicon.ico misc        robots.txt  test
Sephs-MBP:ThumbzArt seph$ 

I know this question seems ridiculous, but it's hard to confirm things for which you have no expected results.

Thank you

Sephs-MBP:streak seph$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/seph/code/golang"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT=""
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"

Sephs-MBP:streak seph$ go version
go version go1.5.2 darwin/amd64

Sephs-MBP:streak seph$ which go
/usr/local/go/bin/go
1 Answers
Related