Go: `LoadGoModules` incorrectly still flags 1.23 as an invalid toolchain
- Langage dominant
- CodeQL
- Étoiles
- 10.1k
- Forks
- 2.1k
- Merge moyen
- 2 j 15 h
- PR mergées (30 j)
- 141
Description
**Description of the false positive**
The Go team had a change of heart in Go 1.23 and re-permitted `go 1.23` as an alias for `go 1.23.0`
The change in behaviour in 1.23 is referenced in this comment on this well-cited GH issue on the confusion around the go directive changes:

https://github.com/golang/go/issues/62278#issuecomment-2062002018
However, CodeQL is flagging this as invalid due to not using 1.N.P syntax:
> Invalid Go toolchain version
>
> As of Go 1.21, toolchain versions [must use the 1.N.P syntax](https://go.dev/doc/toolchain#version).
>
> 1.23 in go.mod does not match this syntax and there is no additional toolchain directive, which may cause some go commands to fail.
**Code samples or links to source code**
Reduced testcase pushed as a sample repo here with CodeQL scanning enabled:
https://github.com/dnwe/go-codeql
**URL to the alert on GitHub code scanning**
https://github.com/dnwe/go-codeql/security/code-scanning/tools/CodeQL/status/configurations/actions-FZTWS5DIOVRC653POJVWM3DPO5ZS6Y3PMRSXC3BNMFXGC3DZONUXGLTZNVWA/c1646cb64b746876ea230e833d950329e5308885d88be821300b330d9b9a7f83
Guide de contribution
Ouvrir le guide de contribution
Piste de recherche
Commencez par le cas de test réduit dans le dépôt d’exemple go-codeql lié et par l’alerte CodeQL, puis suivez le point d’entrée LoadGoModules qui signale la version de toolchain non valide. Confirmez que go 1.23 est accepté comme alias de go 1.23.0 et vérifiez que l’alerte n’est plus produite pour ce cas.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Évaluation
- Stack technique
- go
- Domaine
- devtools
- Type d'issue
- Bug
- Difficulté
- 3/5
- Temps estimé
- 1-2 jours
- Activité
- À l'abandon
- Clarté
- Plutôt claire
- Accessibilité débutants
- 42/100