【问题标题】:Issue setting path in mac terminal [duplicate]mac终端中的问题设置路径[重复]
【发布时间】:2021-05-30 20:58:40
【问题描述】:

我正在使用 VS 代码和 mac 终端进行 Go 开发。 在 VS 代码中,我能够运行所有相关的构建和设置,因为 Go 指向的正确版本如下:

$go version
go version go1.15.6 darwin/amd64

$which go
/usr/local/go/bin/go

但在终端 go 版本中,GOROOT 显示如下不同:

$go version 
go1.16 darwin/amd64

$which go
/usr/local/bin/go

如何在终端中也设置正确的路径?

【问题讨论】:

  • 你可以更新你的$PATH,确保/usr/local/go/bin出现在之前 /usr/local/bin

标签: bash macos go makefile path


【解决方案1】:

您需要在 PATH 环境变量中的默认目录之前使用正确的目录。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-10-06
    • 2017-01-15
    • 2014-02-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多