double2022 2016-01-10 16:58
浏览 1074
已采纳

找不到命令go-安装Go后在Mac上

I want to use golang, 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 terminal zsh: command not found: go. I added the path export PATH=$PATH:/usr/local/go/bin to the bash profile, but I still get the error (I restarted the terminal btw). I uninstalled and reinstalled, but no luck. Can anybody help me troubleshoot this? I'm not sure if there was an error in the installation, but it downloaded ok. I may have to download an older version of go if this doesn't workout.

  • 写回答

5条回答 默认 最新

  • dongyou8087 2016-01-29 04:19
    关注

    Like bjhaid mentioned in the comments above:

    This is happening because you must add your PATH to your ~/.zshrc file.

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

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

    you should then source you .zshrc file:

    . ~/.zshrc
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(4条)

报告相同问题?

悬赏问题

  • ¥100 需要跳转番茄畅听app的adb命令
  • ¥50 寻找一位有逆向游戏盾sdk 应用程序经验的技术
  • ¥15 请问有用MZmine处理 “Waters SYNAPT G2-Si QTOF质谱仪在MSE模式下采集的非靶向数据” 的分析教程吗
  • ¥50 opencv4nodejs 如何安装
  • ¥15 adb push异常 adb: error: 1409-byte write failed: Invalid argument
  • ¥15 nginx反向代理获取ip,java获取真实ip
  • ¥15 eda:门禁系统设计
  • ¥50 如何使用js去调用vscode-js-debugger的方法去调试网页
  • ¥15 376.1电表主站通信协议下发指令全被否认问题
  • ¥15 物体双站RCS和其组成阵列后的双站RCS关系验证