通常都是查看go版本使用的
go help version偶然间看到:
usage: go version [-m] [-v] [file ...] Version prints the build information for Go executables. Go version reports the Go version used to build each of the namedexecutable files. If no files are named on the command line, go version prints its ownversion information. If a directory is named, go version walks that directory, recursively,looking for recognized Go binaries and reporting their versions.By default, go version does not report unrecognized files foundduring a directory scan. The -v flag causes it to report unrecognized files. The -m flag causes go version to print each executable's embeddedmodule version information, when available. In the output, the moduleinformation consists of multiple lines following the version line, eachindented by a leading tab character.
可以看到go version后边是可以带 m ,v命令来查看编译好的二进制文件的版本信息
可以看到-m命令可以打印当前二进制编译版本信息,还可以输出依赖包信息,是和go module对齐的
如果看完觉得有所收获的话,记得点赞关注哦
网友评论