Home >Backend Development >Golang >Why Is My Go Tool \'compile\' Missing After a System Restart?

Why Is My Go Tool \'compile\' Missing After a System Restart?

Mary-Kate Olsen
Mary-Kate OlsenOriginal
2024-11-27 22:08:10219browse

Why Is My Go Tool

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn