Print Go Version

We can use runtime.Versionarrow-up-right function to print Go Version.

Example

package main

import (
    "fmt"
    "runtime"
)

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

Source: GopherSnippetsarrow-up-right

Last updated