Skip to content

fix: add go.mod to Go test fixture so CodeQL can analyze it#285

Merged
avifenesh merged 2 commits intomainfrom
copilot/fix-codeql-execution-errors
Mar 3, 2026
Merged

fix: add go.mod to Go test fixture so CodeQL can analyze it#285
avifenesh merged 2 commits intomainfrom
copilot/fix-codeql-execution-errors

Conversation

Copy link
Contributor

Copilot AI commented Mar 3, 2026

CodeQL detects __tests__/fixtures/repo-map/go/sample.go but exits with an error because Go is a compiled language — without a go.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 file
module github.com/agent-sh/agentsys/testfixtures/repo-map/go

go 1.21

No external dependencies; the fixture only imports fmt and os from 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.

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
@avifenesh avifenesh marked this pull request as ready for review March 3, 2026 13:02
@avifenesh avifenesh self-requested a review as a code owner March 3, 2026 13:02
Copilot AI review requested due to automatic review settings March 3, 2026 13:02
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.mod with a module declaration and a go 1.21 directive, enabling CodeQL autobuild to process the fixture

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@avifenesh avifenesh merged commit 4dfed97 into main Mar 3, 2026
13 checks passed
@avifenesh avifenesh deleted the copilot/fix-codeql-execution-errors branch March 3, 2026 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants