0

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
2
  • 1
    The go directive in the go.mod does not select the compiler used; it just states what version the module expects. Just forget about it and update your installation of Go. No need to fiddle with the version in go.mod.
    – Volker
    Mar 14, 2022 at 9:42
  • the go directive is for compatibility and features required by the module, not to specify patch versions of the compiler.
    – JimB
    Mar 14, 2022 at 13:51

1 Answer 1

2

[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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.