Skip to content

Exclude test_data from module#22

Merged
jpm-canonical merged 4 commits into
mainfrom
ignore-test-data
Jun 29, 2026
Merged

Exclude test_data from module#22
jpm-canonical merged 4 commits into
mainfrom
ignore-test-data

Conversation

@jpm-canonical

@jpm-canonical jpm-canonical commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

By adding a go.mod file into the test_data directory, we are telling Go that it is a different module. It therefore gets ignored by the outer main module. This works around an issue where the colons (:) causes an error when Go imports the module.

Related:

Copilot AI left a comment

Copy link
Copy Markdown

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 introduces a nested Go module under test_data/ so that Go tooling treats test_data as a separate module and does not traverse it when operating on the root module, working around issues caused by : in test data paths.

Changes:

  • Added a test_data/go.mod to make test_data/ a distinct (nested) module and exclude it from the outer module’s package pattern traversal.

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

Comment thread test_data/go.mod Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jpm-canonical jpm-canonical marked this pull request as ready for review June 29, 2026 11:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.

Comment thread test_data/go.mod Outdated
Comment thread test_data/go.mod
Comment on lines +3 to +5
module github.com/canonical/lscompute/test_data

go 1.26.1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Noted. We can do that in a separate PR.

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jpm-canonical jpm-canonical merged commit 290be4b into main Jun 29, 2026
4 checks passed
@jpm-canonical jpm-canonical deleted the ignore-test-data branch June 29, 2026 13:16
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.

Colon in test_data file names prevent go-installing the package

3 participants