zl程序教程

您现在的位置是:首页 >  后端

当前栏目

macOS go 切换版本

Gomacos 版本 切换
2023-09-14 09:09:52 时间

macOS go 切换版本

╰─➤  go version
go version go1.19 darwin/arm64
╰─➤  brew search go
╰─➤  brew install go@1.18
╰─➤  brew unlink go
╰─➤  brew link go@1.18
╰─➤  go version
go version go1.18.8 darwin/arm64

升级版本

╰─➤  go version
go version go1.18.8 darwin/arm64
╰─➤  brew install go@1.19
╰─➤  brew unlink go
Unlinking /opt/homebrew/Cellar/go/1.19.3... 0 symlinks removed.
╰─➤  brew link go@1.19
Unlinking /opt/homebrew/Cellar/go@1.18/1.18.8... 2 symlinks removed.
Linking /opt/homebrew/Cellar/go@1.19/1.19.7... 2 symlinks created.

If you need to have this software first in your PATH instead consider running:
  echo 'export PATH="/opt/homebrew/opt/go@1.19/bin:$PATH"' >> ~/.zshrc
╰─➤  go version
go version go1.19.7 darwin/arm64

参考

  1. 在MacOS下通过brew link切换golang版本