<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/.
Isenção de responsabilidade: Todos os recursos fornecidos são parcialmente provenientes da Internet. Se houver qualquer violação de seus direitos autorais ou outros direitos e interesses, explique os motivos detalhados e forneça prova de direitos autorais ou direitos e interesses e envie-a para o e-mail: [email protected]. Nós cuidaremos disso para você o mais rápido possível.
Copyright© 2022 湘ICP备2022001581号-3