You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This introduces a new `prefixes` configuration option under `allowed` to replace the `domains` option, which is now deprecated. The term `prefixes` is more accurate since the matching logic checks for module prefixes rather than strict domain names.
The `domains` configuration is still supported for backward compatibility but will emit a deprecation warning when used. Both configurations are combined and treated as prefixes under the hood.
Changes include:
- Renaming internal methods from `IsAllowedModuleDomain` to `IsAllowedModulePrefix`
- Adding a deprecation warning in the CLI for `domains`
- Updating the example `.gomodguard.yaml` files
- Updating documentation in the README
- Updating unit tests to reflect the new option
Copy file name to clipboardExpand all lines: README.md
+8-5Lines changed: 8 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,9 +14,9 @@ Allow and block list linter for direct Go module dependencies. This is useful fo
14
14
15
15
Allowed and blocked modules are defined in a `./.gomodguard.yaml` or `~/.gomodguard.yaml` file.
16
16
17
-
Modules can be allowed by module or domain name. When allowed modules are specified any modules not in the allowed configuration are blocked.
17
+
Modules can be allowed by module or prefix name. When allowed modules are specified any modules not in the allowed configuration are blocked.
18
18
19
-
If no allowed modules or domains are specified then all modules are allowed except for blocked ones.
19
+
If no allowed modules or module prefixes are specified then all modules are allowed except for blocked ones.
20
20
21
21
The linter looks for blocked modules in `go.mod` and searches for imported packages where the imported packages module is blocked. Indirect modules are not considered.
22
22
@@ -41,8 +41,11 @@ allowed:
41
41
- github.com/go-xmlfmt/xmlfmt
42
42
- github.com/phayes/checkstyle
43
43
- github.com/mitchellh/go-homedir
44
-
domains: # List of allowed module domains
45
-
- golang.org
44
+
- github.com/confluentinc/confluent-kafka-go/v2 # Allow v2 only
45
+
prefixes: # List of allowed module prefixes (Replaced domains which is now deprecated)
46
+
- golang.org # Allow all golang.org modules
47
+
- github.com/kubernetes # Allow all Kubernetes modules
48
+
- github.com/apache/arrow-go # Allow all Apache Arrow module major versions
0 commit comments