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 6315bee commit d554879Copy full SHA for d554879
exptostd.go
@@ -311,7 +311,18 @@ func getGoVersion(pass *analysis.Pass) int {
311
return goDevel // true
312
}
313
314
- vParts := strings.Split(strings.TrimPrefix(pkgVersion, "go"), ".")
+ raw := strings.TrimPrefix(pkgVersion, "go")
315
+
316
+ // prerelease version (go1.24rc1)
317
+ idx := strings.IndexFunc(raw, func(r rune) bool {
318
+ return (r < '0' || r > '9') && r != '.'
319
+ })
320
321
+ if idx != -1 {
322
+ raw = raw[:idx]
323
+ }
324
325
+ vParts := strings.Split(raw, ".")
326
327
v, err := strconv.Atoi(strings.Join(vParts[:2], ""))
328
if err != nil {
0 commit comments