if i have go version 1.7 how do i know which minor i am using?

huangapple go评论85阅读模式
英文:

if i have go version 1.7 how do i know which minor i am using?

问题

我对GO没有任何了解,从未使用过。但我曾帮助一个团队,他们需要更新他们的项目。

最近发现了一个错误,他们需要将go的版本更新到1.17.8,但在go.mod文件中我看到他们使用的是1.17。

如果我输入1.17.8,会出现格式错误,因为它必须是X.X的格式,不能是X.X.X。我如何知道我正在使用的是哪个次要版本?或者如何确保我使用的是正确的版本?

go 1.17.8  //编译错误 -> go version '1.17.8': 必须匹配格式1.23(我需要这个版本)
go 1.17  //编译正常
英文:

I have no idea about GO, I have never worked with it. But I have helped a team and they need to update their project.

Recently a bug has been found and they have to update the version of go to 1.17.8 but in the go.mod I see that they use 1.17.

if I put 1.17.8 I get a format error because it must be X.X it can't be X.X.X, how do I know which version of minior I'm using? or how can I be sure I'm using the correct version.

go 1.17.8  //Compile Error -> go version '1.17.8': must match format 1.23 (I NEED THIS ONE)
go 1.17  //Compile OK

答案1

得分: 2

如何确保我使用的是正确的版本?

通过安装正确的版本来确保。go.mod中的go指令对你的安装没有影响。

英文:

> [H]ow can I be sure I'm using the correct version.

By installing the correct version. The go directive in go.mod has no influence on your installation.

huangapple
  • 本文由 发表于 2022年3月14日 17:34:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/71465545.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定