Fix GOROOT path for Apple Silicon Macs in setup instructions

The previous instructions incorrectly set GOROOT to '/opt/homebrew/bin/go', which points to the Go binary rather than the Go root directory. This caused errors when running Go commands on Apple Silicon-based Macs.

I updated the instructions to dynamically determine the correct GOROOT path using Homebrew, ensuring compatibility across different environments. This change resolves the 'go: cannot find GOROOT directory' issue on M1/M2 Macs.
This commit is contained in:
Aaron Culich 2024-09-22 20:37:52 -07:00
parent f4044cde7e
commit 4a34355c3b

View File

@ -137,9 +137,9 @@ export PATH=$GOPATH/bin:$GOROOT/bin:$HOME/.local/bin:$PATH
for Apple Silicon based macs
```bash
# Golang environment variables
export GOROOT=/opt/homebrew/bin/go
export GOROOT=$(brew --prefix go)/libexec
export GOPATH=$HOME/go
export PATH=$GOPATH/bin:$GOROOT/bin:$HOME/.local/bin:$PATH:
export PATH=$GOPATH/bin:$GOROOT/bin:$HOME/.local/bin:$PATH
```
### Setup