Home > Backend Development > Golang > Why Does `go version` Show an \'xgcc\' Version Instead of My Installed Go Version?

Why Does `go version` Show an \'xgcc\' Version Instead of My Installed Go Version?

Susan Sarandon
Release: 2024-11-20 14:50:15
Original
328 people have browsed it

Why Does `go version` Show an

Go's Confusing Version Output

In Go, using the go version command can sometimes yield unexpected results. Instead of displaying the installed Go version, it may indicate an "xgcc" version. This discrepancy can be perplexing, especially when the installed version is known to be different.

To understand this issue, it's important to know that many Linux distributions include Go through their package managers, such as APT. However, this often installs a version of Go that's compiled with GCC, known as "xgcc". This xgcc version may differ from the one installed from the official Go tarball, which uses the Clang compiler.

In your case, you've installed Go 1.4.2 from the tarball. However, your system still has the xgcc version installed through APT. To resolve this, you can remove the xgcc version using the following command:

sudo apt-get remove gccgo
Copy after login

After removing the xgcc version, running go version should now display the correct installed version of Go, which in your case is 1.4.2.

The above is the detailed content of Why Does `go version` Show an 'xgcc' Version Instead of My Installed Go Version?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template