Go Tool "compile" Not Found
Recently, a user encountered an issue while building a Go project after restarting their Ubuntu desktop. They had previously installed Go by downloading the binary tarball, not through apt-get. After installing godoc using apt-get, they encountered the error: "go tool: no such tool 'compile'."
The user's go version was 1.10.1, and they could still run compiled Go code. After troubleshooting, the issue was resolved by running the command:
export GOROOT=
This suggests that the GOROOT environment variable, which points to the directory where Go tools are installed, had become corrupted or set incorrectly. By resetting it, the user was able to access the compile tool again.
The above is the detailed content of Why Is My Go Tool \'compile\' Missing After a System Restart?. For more information, please follow other related articles on the PHP Chinese website!