Summary
--exclude-module <name>@<version> (and --exclude-package <name>@<version>) ignore the @version part. The documented format is module-name[@version], which implies version-level exclusion, but the whole module/package is excluded regardless of the version supplied.
Details
In blacklist mode Filter.Match matches by name only:
internal/mirror/modules/filter.go — Match checks f.modules[mod.Name]; the parsed version constraint is stored but never consulted.
The @version is still parsed at flag-processing time (so it must be a valid semver/constraint, otherwise the command errors), but it has no effect on what is excluded.
Packages reuse modules.Filter, so --exclude-package behaves the same way.
Impact
Silent over-exclusion. A user running --exclude-module foo@1.2.0 expecting to drop a single version actually drops all versions of foo, with no warning.
Expected
Either honor the version constraint in blacklist mode, or reject/document --exclude-module / --exclude-package as name-only.
As of main (62132d6).
Summary
--exclude-module <name>@<version>(and--exclude-package <name>@<version>) ignore the@versionpart. The documented format ismodule-name[@version], which implies version-level exclusion, but the whole module/package is excluded regardless of the version supplied.Details
In blacklist mode
Filter.Matchmatches by name only:internal/mirror/modules/filter.go—Matchchecksf.modules[mod.Name]; the parsed version constraint is stored but never consulted.The
@versionis still parsed at flag-processing time (so it must be a valid semver/constraint, otherwise the command errors), but it has no effect on what is excluded.Packages reuse
modules.Filter, so--exclude-packagebehaves the same way.Impact
Silent over-exclusion. A user running
--exclude-module foo@1.2.0expecting to drop a single version actually drops all versions offoo, with no warning.Expected
Either honor the version constraint in blacklist mode, or reject/document
--exclude-module/--exclude-packageas name-only.As of
main(62132d6).