Category

How to Verify My Golang Installation on Linux in 2025?

2 minutes read

In 2025, Golang remains a popular choice for developers looking to build fast and efficient applications. If you’ve recently installed Golang on your Linux machine, verifying the installation is a crucial next step. This guide will walk you through a few key steps to ensure your Golang environment is properly set up and ready for development.

Step 1: Open the Terminal

First, open your terminal application. You can usually find it in your applications menu or launch it quickly using keyboard shortcuts like Ctrl + Alt + T on most Linux distributions.

Step 2: Check the Golang Version

Checking the installed version of Golang is a straightforward way to verify that the installation process was successful. Enter the following command in your terminal:

go version

You should see an output similar to this:

go version go1.17.1 linux/amd64

The exact version number (go1.17.1) will vary depending on the version you’ve installed. If you see a message indicating the version number, congratulations—Golang is installed on your system!

Step 3: Verify Go Environment Variables

A critical part of the Golang setup is ensuring that your environment variables are configured correctly. You can check these settings by entering:

go env

Look for the following entries in the output:

  • GO111MODULE: This should typically be set to on.
  • GOPATH: This is the path to your Go workspace, often set as $HOME/go.
  • GOROOT: This is the path where Go is installed. It should reflect the installation directory.

Correctly set environment variables indicate that Golang is ready to use.

Step 4: Compile and Run a Go Program

To further confirm your setup, try compiling and running a simple Go program. Create a new file named hello.go:

package mainimport "fmt"func main() {    fmt.Println("Hello, Golang!")}

Compile and run the program using:

go run hello.go

You should see the output:

Hello, Golang!

If you encounter any errors during this step, revisit your installation and environment settings to ensure everything is configured properly.

Additional Resources

By following these verification steps, you can confidently start working on Go projects on your Linux machine in 2025. Happy coding!“`

This article provides detailed steps for verifying a Golang installation on Linux, tailored for 2025, and includes links to additional resources for different operating systems to enhance SEO and user engagement.