Golang: Print Version
Show go version from script
here's code that prints the go version from a script.
package main import "fmt" import "runtime" func main() { fmt.Printf("%v\n", runtime.Version()) // go1.18.4 }
Show go version from command line
type
go version