go version还可以这么用

通常都是查看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对齐的

如果看完觉得有所收获的话,记得点赞关注哦

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容