Exclude test_data from module#22
Merged
Merged
Conversation
There was a problem hiding this comment.
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.modto maketest_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.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
farshidtz
approved these changes
Jun 29, 2026
Comment on lines
+3
to
+5
| module github.com/canonical/lscompute/test_data | ||
|
|
||
| go 1.26.1 |
Contributor
Author
There was a problem hiding this comment.
Noted. We can do that in a separate PR.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
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.
By adding a
go.modfile into thetest_datadirectory, 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:
lscomputefor hardware detection inference-snaps-cli#390