Allow for missing go directive in go.mod#13175
Merged
JamieMagee merged 1 commit intomainfrom Sep 24, 2025
Merged
Conversation
ryanbrandenburg
approved these changes
Sep 24, 2025
We're seeing the following issue in some repositories ``` Passed `nil` into T.must file_parser.rb:70:in 'Dependabot::GoModules::FileParser#go_version ``` The issue is that the `go` directive in `go.mod` files was optional before Go 1.21[1]. So some projects which rely on vendor dependencies that have not been updated since then will not have the `go` directive. > The go directive sets the minimum version of Go required to use this module. Before Go 1.21, the directive was advisory only; now it is a mandatory requirement: Go toolchains refuse to use modules declaring newer Go versions. This change makes it optional in Dependabot as well. [1]: https://go.dev/doc/modules/gomod-ref#go
0333346 to
01e8991
Compare
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What are you trying to accomplish?
We're seeing the following issue in some repositories
The issue is that the
godirective ingo.modfiles was optional before Go 1.211. So some projects which rely on vendor dependencies that have not been updated since then will not have thegodirective.This change makes it optional in Dependabot as well.
Anything you want to highlight for special attention from reviewers?
How will you know you've accomplished your goal?
Checklist
Footnotes
https://go.dev/doc/modules/gomod-ref#go ↩