Home >Backend Development >Golang >How to check the go language version
How to check the go language version: first introduce the fmt and runtime packages, and then use the Println() and Version() methods to output the version number. The specific syntax format is "fmt.Println(runtime.Version() )".
The operating environment of this tutorial: windows10 system, GO 1.12.9, thinkpad t480 computer.
Since I am learning the go language, checking the version number is not as convenient as python. python can do it with one command python -V, but go is more troublesome. Please see the following
package main import ( "fmt" "runtime" ) func main() { fmt.Println(runtime.Version()) } // 输出结果 go1.12.9
Recommended learning:Golang tutorial
The above is the detailed content of How to check the go language version. For more information, please follow other related articles on the PHP Chinese website!