patterngoCritical
Install go with brew, and running the gotour
Viewed 0 times
withrunninginstallandthebrewgotour
Problem
I was following the http://tour.golang.org/ untill I got to the third step about that tells you that you can install the gotour on your system.
After that I've installed the go language with brew by:
Then I downloaded the gotour by:
When I tried to launch the gotour it didnt recognise the command:
and
and
So I tried to see the go path and it was empty,
so I defined the GOPATH:
Now I can run the gotour by runing
But I'm insecure about my go enviroment.. wasn't I suposed to be able to run gotour by
or just by typing (like is described on this website http://www.moncefbelyamani.com/how-to-install-the-go-tour-on-your-mac/):
I would like to know if i'm doing things the right way since I'm new to the go programing language.
After that I've installed the go language with brew by:
brew install hg
brew install goThen I downloaded the gotour by:
go get code.google.com/p/go-tour/gotourWhen I tried to launch the gotour it didnt recognise the command:
$ gotour
-bash: gotour: command not foundand
$ go gotourand
$ ./gotourSo I tried to see the go path and it was empty,
echo $GOPATHso I defined the GOPATH:
GOPATH=/usr/local/Cellar/go/1.0.2/src/pkg/code.google.com/p/
export GOPATHNow I can run the gotour by runing
./gotourBut I'm insecure about my go enviroment.. wasn't I suposed to be able to run gotour by
go run gotouror just by typing (like is described on this website http://www.moncefbelyamani.com/how-to-install-the-go-tour-on-your-mac/):
gotourI would like to know if i'm doing things the right way since I'm new to the go programing language.
Solution
Installing go 1.4 with homebrew on OSX:
1) Create Directories
2) Setup your paths
3) Install Go
4) "go get" the basics
5) Start here: https://golang.org/doc/code.html at "your first program"
1) Create Directories
mkdir $HOME/Go
mkdir -p $HOME/Go/src/github.com/user2) Setup your paths
export GOPATH="${HOME}/.go"
export GOROOT="$(brew --prefix golang)/libexec"
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin3) Install Go
brew install go4) "go get" the basics
go get golang.org/x/tools/cmd/godoc5) Start here: https://golang.org/doc/code.html at "your first program"
Code Snippets
mkdir $HOME/Go
mkdir -p $HOME/Go/src/github.com/userexport GOPATH="${HOME}/.go"
export GOROOT="$(brew --prefix golang)/libexec"
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/binbrew install gogo get golang.org/x/tools/cmd/godocContext
Stack Overflow Q#12843063, score: 196
Revisions (0)
No revisions yet.