Closed ialidzhikov closed 1 year ago
/cc @incu6us
@ialidzhikov try to use v3.4.4. And reopen the issue in case of a problem
I see that v3.4.4 includes https://github.com/incu6us/goimports-reviser/pull/133. which only bumps the go version for the project.
The issue report is about the cases when you run goimports-reviser
against a module with go version directive in format X.Y.Z
. For example
module github.com/foo/bar
go 1.21.0
goimports-reviser
still fails with:
go.mod:3: invalid go version '1.21.0': must match format 1.23
Usage of goimports-reviser:
<Usage text is omitted>
Let me know if you need more detailed steps to reproduce.
And reopen the issue in case of a problem
When a maintainer closes an issue, the reporter cannot open it. Can you please reopen it?
As I see in the official documentation(https://go.dev/doc/modules/gomod-ref#module-syntax) the version must have format like X.Y
.
Mentioned error message telling you that you are using wrong format(...must match format 1.23
). So, in your case the string should be go 1.21
See https://go.dev/doc/toolchain#version:
Before Go 1.21, the initial release of a Go toolchain was version 1.N, not 1.N.0, so for N < 21, the ordering is adjusted to place 1.N after the release candidates.
You can also check all the comments in https://github.com/golang/go/issues/62278. My understanding is that with go1.21 the expect format is go X.Y.Z
and go X.Y
refers to a development version of the X.Y
version. So, goimports-reviser
has to definitely support the go X.Y.Z
format.
fixed with new version v3.4.5
:
Thank you @incu6us !
goimports-reviser@v3.4.5 resolves the issue.
I'm also having this issue, but I regenerated a go.mod file via go mod init XXXX
, the original go.mod file was generated in vscode, but I ran into problems opening it in goland
@2048Nemo update the tool to the latest version
With go1.21 the module version has to be in format
X.Y.Z
. See https://github.com/golang/go/issues/62278 and https://github.com/dependabot/dependabot-core/issues/7895.Trying to use 1.21.0 as module version
fails with: