Goのインストール
最新バージョンの記載はGoのWebサイト に記載があります。
$ brew install go
以下のようにバージョンが正しく表示されれば成功です。
$ go version
go version go1.22.5 darwin/amd64
パスを通す
$ vim ~/.bash_profile
下記を追記
.bash_profile
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:/usr/local/go/bin
.bash_profileを反映
$ source ~/.bash_profile