繁体   English   中英

没有为命令 go 设置版本

[英]No version set for command go

我试图在 Ubuntu 机器上用go version检查我的go可执行文件的版本,但是我收到以下错误:

No version set for command go
Consider adding one of the following versions in your config file at 
golang 1.16.8
golang 1.17.1

我该如何解决这个问题? 我之前没有使用配置文件的经验,我在谷歌上搜索但没有发现任何可以解决这个问题的方法。

这似乎是来自 asdf-vm/asdf 的错误消息, asdf-vm/asdf是一种使用单个 CLI 工具管理多个运行时版本的工具,可通过插件进行扩展。
您可以在asdf-vm/asdf issue 838中看到该错误消息。

配置文件应该在$HOME/.tool-versions

要解决此问题,如本例所示

asdf plugin add go
asdf install go latest

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM