How to Check Golang Version in Linux

Hey! If you love Go and building Go apps as much as I do, let's connect on Twitter or LinkedIn. I talk about this stuff all the time!

Want to learn how to build better Go applications faster and easier? You can.

Check out my course on the Go Standard Library. You can check it out now for free.


If you’re looking to learn how to check the Golang version in Linux, you’re in the right place. Before diving into the code examples, let’s first understand the theory behind checking the Golang version in Linux.

Golang is an open-source programming language that is available for multiple platforms, including Linux. It is an evolving language that receives regular updates and improvements. To make sure you have the latest features and bug fixes, it’s important to keep your Golang installation up to date.

In Linux, there are different ways to check the Golang version. One way is to use the command line. Here’s how:

go version

In the command above, we use the “go version” command to check the Golang version. This command will display the version number along with other details such as the build information and the compiler version.

Another way to check the Golang version in Linux is to use the Golang environment variables. Here’s an example:

echo $GOROOT

In the command above, we use the “echo $GOROOT” command to check the location of the Golang installation directory. The GOROOT environment variable holds the path to the root directory of the Golang installation.

Once you know the location of the Golang installation directory, you can find the version number by navigating to that directory and reading the VERSION file. Here’s an example:

cd /usr/local/go
cat VERSION

In the command above, we navigate to the Golang installation directory (/usr/local/go) and read the VERSION file to find the Golang version.

So why would someone want to check the Golang version in Linux? One common use case is when working with third-party libraries or frameworks that require a specific Golang version. By checking the Golang version, you can make sure that your installation meets the requirements of the libraries or frameworks you’re using.

In conclusion, checking the Golang version in Linux is an important task that you’ll need to perform frequently in your Golang programming journey. By using the command line or environment variables, you can easily check the Golang version and make sure that your installation is up to date.

I hope you found this tutorial helpful. If you have any questions or comments, please feel free to leave them below.


Questions or comments? Reach out to me


Learn how to leverage the Go Standard Library like a PRO.

I just created a new course, The Go Standard Library, check it out!