This repository has been archived by the owner on Apr 1, 2022. It is now read-only.
Gomod: ignore local modules in a multi-module project #171
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.
The
replace
directive in gomodules projects is problematic: in addition to its typically-bad use, it's also used to emulate multi-project structures if the replace target is a directory, rather than the usual package/version combo:the Right Way™️ to fix this is to do what we've done with maven projects previously, which is to construct multi-project "closures" and extract dependency graphs from those. I've done this for gomodules projects on another branch: https://github.com/fossas/spectrometer/tree/go-multi-module-projects
This is a simpler approach. It handles the vast majority of usecases seen in the wild. We improve our fallback static-analysis strategy by ignoring local packages.
The best-analysis case (via running commands with the
go
cli) was already covered in a previous PR.