<h2>Brew Go Setup vs. Command Line Execution</h2>
You initially installed Go using Homebrew, a package manager for macOS. While Homebrew simplifies the installation process, it introduces a potential discrepancy between command line execution and expected behavior.
To resolve the issue you encountered, follow these steps:
<h3>1. Create Necessary Directories</h3>
<pre>mkdir $HOME/Go
mkdir -p $HOME/Go/src/github.com/user
</pre>
<h3>2. Configure Environment Variables</h3>
<pre>export GOPATH=$HOME/Go
export GOROOT=/usr/local/opt/go/libexec
export PATH=$PATH:$GOPATH/bin
export PATH=$PATH:$GOROOT/bin
</pre>
<h3>3. Install Godoc</h3>
<pre>go get golang.org/x/tools/cmd/godoc
</pre>
After these steps, you can execute the gotour command by typing go run gotour. Additionally, you should also be able to launch it directly using gotour.
However, it's important to note that the installation method you used (Homebrew) may have modified your system paths and environment variables, potentially introducing potential conflicts. To avoid these issues and ensure the intended functionality, it's recommended to install Go from the official source at https://golang.org/dl/.
Haftungsausschluss: Alle bereitgestellten Ressourcen stammen teilweise aus dem Internet. Wenn eine Verletzung Ihres Urheberrechts oder anderer Rechte und Interessen vorliegt, erläutern Sie bitte die detaillierten Gründe und legen Sie einen Nachweis des Urheberrechts oder Ihrer Rechte und Interessen vor und senden Sie ihn dann an die E-Mail-Adresse: [email protected] Wir werden die Angelegenheit so schnell wie möglich für Sie erledigen.
Copyright© 2022 湘ICP备2022001581号-3