fix: add go.mod to Go test fixture so CodeQL can analyze it#285
Merged
fix: add go.mod to Go test fixture so CodeQL can analyze it#285
Conversation
Co-authored-by: avifenesh <55848801+avifenesh@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix CodeQL exit errors for Go files
fix: add go.mod to Go test fixture so CodeQL can analyze it
Mar 3, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a minimal go.mod file to the Go test fixture directory so that CodeQL (and Go tooling in general) can treat the directory as a proper Go module and compile/analyze sample.go. Without a go.mod, Go's build system has no module context and CodeQL's autobuild skips the file entirely.
Changes:
- Adds
__tests__/fixtures/repo-map/go/go.modwith a module declaration and ago 1.21directive, enabling CodeQL autobuild to process the fixture
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
CodeQL detects
__tests__/fixtures/repo-map/go/sample.gobut exits with an error because Go is a compiled language — without ago.mod, CodeQL has no build target and skips the file entirely.Changes
__tests__/fixtures/repo-map/go/go.mod— adds a minimal Go module declaration for the fixture, enabling CodeQL's autobuild to compile and analyze the fileNo external dependencies; the fixture only imports
fmtandosfrom stdlib.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.