Skip to main content
  1. Tutorials/

How to check your Go version

··14 mins

Quick Answer: Run go version in your terminal to see your installed Go version. The current stable version is Go 1.25.5 (released December 2, 2025).
  • To check the version of Go installed on your system, run go version in your terminal/shell/command line.
  • To find out what version of Go a binary was built with, use go version "app-name" where "app-name" is the name of your built application.
  • To figure out at runtime what version of Go an app was built with, use the runtime.Version() function.

Check the Go version installed on your system #

To find out what version of Go is installed on your system, open your terminal/command line/shell, and run the command:

go version

The version is a command of the go tool which prints out version information for Go executables. If no additional arguments are given, it prints out the Go version installed on your computer.

Example of the go version output:

go version go1.25.5 darwin/amd64

If you want to learn more about the go version, check the documentation using the command:

go help version

Check what version of Go a binary was built with #

To find out what version of Go a given application was built with, just use the go version command, passing the path to the binary as an argument:

go version <path/to/the/binary>

Example #

Create a simple app, for example the “Hello World” application, and save it as a main.go file:

package main

import "fmt"

func main() {
    fmt.Println("Hello World!")
}

Then build the application using the command:

go build -o hello-world

Now you can check what version of Go the hello-world app was built with:

go version hello-world

In the output, you should see the application name and version:

hello-world: go1.25.5

Check build information and module dependencies #

Starting with Go 1.13, you can use the go version -m command to inspect detailed build information including module dependencies embedded in a binary:

go version -m <path/to/the/binary>

This command displays not only the Go version used to build the binary, but also:

  • Module path and version
  • Dependency modules and their versions
  • Build settings

Example #

Using the same hello-world binary from the previous example:

go version -m hello-world

Example output:

hello-world: go1.25.5
        path    example.com/hello-world
        mod     example.com/hello-world (devel)
        build   -buildmode=exe
        build   -compiler=gc
        build   CGO_ENABLED=1

This is particularly useful for understanding the exact build configuration and dependencies of a production binary.

Check at runtime what version of Go the app was built with #

If you want to check directly in the application what version of Go it was built with, you can use the runtime.Version() function. It returns the Go version information, the same as when using the go version <path/to/the/binary> command.

Example #

Create a new app that prints Go version information and save it as a main.go file:

package main

import (
    "fmt"
    "runtime"
)

func main() {
    fmt.Println("Hello World!")
    fmt.Printf("The application was built with the Go version: %s\n", runtime.Version())
}

Build the application using the command:

go build -o hello-world-with-version

Run the application:

./hello-world-with-version

In the output, you should see the Go version string:

Hello World!
The application was built with the Go version: go1.25.5

Check Go version using go env #

Another way to check your Go version is by using the go env command, which provides comprehensive information about your Go environment.

To get just the Go version:

go env GOVERSION

Example output:

go1.25.5

To see all Go environment variables (including GOVERSION, GOROOT, GOPATH, and more):

go env

This will display a complete list of environment variables that Go uses, which can be helpful for debugging and understanding your Go installation configuration.

Current Go (Golang) version #

  • The current major Go version is go1.25 (released on August 12, 2025). Read the Go 1.25 Release Notes for more information.
  • The latest minor Go version is go1.25.5 (released on December 2, 2025). Read the Release History for more information about Go 1.25.5.

Go support policy #

Go follows a support policy where each major release is supported until there are two newer major releases. This means:

  • Currently supported versions: Go 1.24 and Go 1.25
  • Support includes: Security updates and critical bug fixes
  • Older versions: Go 1.23 and earlier are no longer supported

For example, when Go 1.26 is released, Go 1.24 will become the oldest supported version, and Go 1.23 will no longer receive updates.

It’s recommended to stay on one of the two most recent major Go versions to ensure you receive security patches and critical fixes. You can read more about the Go Release Policy on the official documentation.

How to upgrade to a newer version of Go? #

To update your Go version, go to the official Download and install website. There you will find up-to-date information on how to update an existing version of Go on Linux, macOS, and Windows.

Troubleshooting common issues #

“go: command not found” #

If you get this error, Go is either not installed or not in your system’s PATH. To fix this:

  1. Verify Go is installed by checking if the Go directory exists (typically /usr/local/go on Linux/macOS or C:\Go on Windows)
  2. Add Go to your PATH by adding the following to your shell profile (.bashrc, .zshrc, etc.):
    export PATH=$PATH:/usr/local/go/bin
    
  3. Reload your shell or run source ~/.bashrc (or equivalent for your shell)
  4. Verify with go version

Different versions in different terminals #

If you see different Go versions in different terminal windows, you may have multiple Go installations.

Diagnosing the issue:

First, identify which Go binary is being used and where it’s installed:

which go        # Shows which Go binary is being used
go env GOROOT   # Shows where Go is installed
go env GOPATH   # Your Go workspace
go env GOBIN    # Where go install places binaries

Fixing the issue:

Remove old installations and ensure only one Go version is in your PATH, or use version managers like gvm or goenv to manage multiple versions cleanly.

Here are some related Go commands and resources that might be helpful:

Useful Go commands #

  • go version - Check Go version
  • go env - Display Go environment variables
  • go help - Display help documentation
  • go doc - Show documentation for packages
  • go list -m all - List all modules in your project

External resources #

Go (Golang) version history #

Major Go releases are labeled as, for example, 1.16, 1.17, 1.18 (in the list below, they are written in a larger font). In addition, there are support releases introducing minor fixes labeled as, for example, 1.17.1, 1.17.2, and so on. If you want to learn more about the release policy of Go, read the official documentation.

Go was first publicly announced on November 10, 2009.

The first major version of Go - go1 was released on March 28, 2012.