package-filter
The package-filter
join point is node-agnostic. It matches any node within packages whose import paths match the specified glob pattern.\n\nSupports two formats:\n- String format: matches packages globally using the pattern\n- Object format: allows specifying root
to limit matching to the current module only\n\nSupports glob patterns including:\n- *
matches any sequence within a path segment\n- **
matches any sequence across multiple path segments (globstar)\n- ?
matches any single character except path separator\n- [class]
matches any character in the character class\n\nWhen root: true
, only matches packages within the current Go module and applies the pattern to relative paths within the module. When root: false
(default), matches packages from any module using the full import path.
Examples
package-filter: github.com/ACME/*/*/my*
package-filter: "**/internal/*"
package-filter:
pattern: github.com/external/library/internal/*
package-filter:
pattern: internal/*
root: true
package-filter:
root: true