Command not found go — on Mac after installing Go

后端 未结 7 2066
逝去的感伤
逝去的感伤 2021-02-03 18:24

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

7条回答
  •  余生分开走
    2021-02-03 19:16

    Add Go PATH to your ~/.zshrc file. Open file to edit as -

    vim ~/.zshrc
    

    in the ~/.zshrc you should add the line:

    export PATH=$PATH:/usr/local/go/bin
    

    Once done, close and reopen terminal and you are good to go. For test, you can do -

    go version
    

    It will show output something like -

    go version go1.15.1 darwin/amd64
    

提交回复
热议问题