Closed13
asdf を使って go を入れる

そもそも asdf
が入ってないのでそこから。


brew install coreutils curl git

brew install asdf

zsh
を使ってるのでその設定
https://asdf-vm.com/guide/getting-started.html#_3-install-asdf
echo -e "\n. $(brew --prefix asdf)/libexec/asdf.sh" >> ${ZDOTDIR:-~}/.zshrc

設定読み込み直し
source ~/.zshrc

インストールチェック
asdf --version
v0.14.0

golang
を入れる

プラグインを入れる
asdf plugin add golang https://github.com/asdf-community/asdf-golang.git

最新の golang
を入れる
asdf install golang latest

ドキュメントの通りに実行する。
. ~/.asdf/plugins/golang/set-env.zsh
No version is set for command go
Consider adding one of the following versions in your config file at
golang 1.21.6

たぶんこのディレクトリで設定してないから出てくるメッセージ。
グローバルに設定してあげる。
asdf global go latest

インストールできました 🎉
go version
go version go1.21.6 darwin/arm64
このスクラップは2024/01/31にクローズされました