We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f385089 commit 1bbdad7Copy full SHA for 1bbdad7
usetesting.go
@@ -172,7 +172,18 @@ func (a *analyzer) isGoSupported(pass *analysis.Pass) bool {
172
return true
173
}
174
175
- vParts := strings.Split(strings.TrimPrefix(pkgVersion, "go"), ".")
+ raw := strings.TrimPrefix(pkgVersion, "go")
176
+
177
+ // prerelease version (go1.24rc1)
178
+ idx := strings.IndexFunc(raw, func(r rune) bool {
179
+ return (r < '0' || r > '9') && r != '.'
180
+ })
181
182
+ if idx != -1 {
183
+ raw = raw[:idx]
184
+ }
185
186
+ vParts := strings.Split(raw, ".")
187
188
v, err := strconv.Atoi(strings.Join(vParts[:2], ""))
189
if err != nil {
0 commit comments