Go: Find build version

fmt.Println(runtime.Version())

The function runtime.Version returns the Go tree’s version string, which is

$ go version

The command go version prints the version in the same format as runtime.Version.

Comments

Be the first to comment!