Find build version

yourbasic.org/golang
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.

More code examples

Go blueprints: code for com­mon tasks is a collection of handy code examples.

Share this page: