For the complete documentation index, see llms.txt. This page is also available as Markdown.

Print Go Version

We can use runtime.Version function to print Go Version.

Example

package main

import (
    "fmt"
    "runtime"
)

func main() {
    fmt.Println("Go version: " + runtime.Version())
}

Source: GopherSnippets

Last updated