I want to use Go, but I\'m having trouble running the go command. I installed go1.5.2 darwin/amd64, but when I run the command go version
, I get an error in the ter
In my case I was not having ~/.zshrc
profile file. Followed below steps to make it work.
Mac os version : Mojave (10.14.6)
Go version : go1.13.1 darwin
/amd64
Reference link : https://www.cyberciti.biz/faq/installing-go-programming-language-on-mac-os-x/
As mentioned in link, when i was executing "go env" command, it was throwing error "go command not found". Adding "export PATH=$PATH:/usr/local/go/bin" in "~/.bashrc
" profile file didn't do any magic!!
step 1 : Create .zshrc
profile under home path.
$ cd /User/xxxx
(Eg : /User/tapan
)
$ touch .zshrc
step 2 : append 'PATH' with go in .zshrc
file.
$ vim .zshrc
$ export PATH=$PATH:/usr/local/go/bin
step 3 : source your .zshrc
file
$ source ~/.zshrc
step 4 : execute "go env" command, you should be able to see local environment details.
$ go env