問題:
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. 我正在關注http://tour.golang.org/,直到我進入第三步,告訴你可以在你的系統上安裝gotour。 After that I've installed the go language with brew by: 之後我通過以下方式安裝了go語言:
brew install hg
brew install go
Then I downloaded the gotour by: 然後我通過以下方式下載了我們的
go get code.google.com/p/go-tour/gotour
When I tried to launch the gotour it didnt recognise the command: 當我試圖啓動它時,它沒有識別命令:
$ gotour
-bash: gotour: command not found
and 和
$ go gotour
and 和
$ ./gotour
So I tried to see the go path and it was empty, 所以我試圖看到go路徑,它是空的,
echo $GOPATH
so I defined the GOPATH: 所以我定義了GOPATH:
GOPATH=/usr/local/Cellar/go/1.0.2/src/pkg/code.google.com/p/
export GOPATH
Now I can run the gotour by runing 現在我可以通過跑步來運行
./gotour
But I'm insecure about my go enviroment.. wasn't I suposed to be able to run gotour by 但是我對自己的環境沒有安全感......我不是因爲能夠奔跑而活着的
go run gotour
or just by typing (like is described on this website http://www.moncefbelyamani.com/how-to-install-the-go-tour-on-your-mac/ ): 或者只是打字(就像在這個網站上描述的那樣http://www.moncefbelyamani.com/how-to-install-the-go-tour-on-your-mac/ ):
gotour
I would like to know if i'm doing things the right way since I'm new to the go programing language. 我想知道我是不是以正確的方式做事,因爲我是go the programing語言的新手。