Command not found go — on Mac after installing Go

后端 未结 7 2166
逝去的感伤
逝去的感伤 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:11

    Add the following line to ~/.bashrc or ~/.bash_profile file at the end on your Mac

    alias go="/usr/local/go/bin/go"

    And in the Terminal

    source ~/.bashrc or source ~/.bash_profile in an existing terminal session. Or to see the new changes you can also re-open a new terminal session.

提交回复
热议问题