Skip to content

Commit 71d6466

Browse files
committed
address pr comments #2
1 parent 70bb732 commit 71d6466

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

website/catalog/go/match-package-import.md

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@
66

77
A generic rule template for detecting imports of specific packages in Go source code. This rule can be customized to match any package by modifying the regex pattern, making it useful for security auditing, dependency management, and compliance checking.
88

9+
This rule identifies Go import statements based on the configured regex pattern, including:
10+
11+
Direct imports: `import "package/name"`
12+
Versioned imports: `import "package/name/v4"`
13+
Subpackage imports: `import "package/name/subpkg"`
14+
Grouped imports within `import () blocks`
15+
916
### YAML
1017

1118
```yaml
@@ -15,19 +22,7 @@ rule:
1522
kind: import_spec
1623
has:
1724
regex: PACKAGE_PATTERN_HERE
18-
```
19-
20-
### Configuration
21-
Replace PACKAGE_PATTERN_HERE with your target package pattern
22-
23-
### What it matches
24-
25-
This rule identifies Go import statements based on the configured regex pattern, including:
26-
27-
Direct imports: `import "package/name"`
28-
Versioned imports: `import "package/name/v4"`
29-
Subpackage imports: `import "package/name/subpkg"`
30-
Grouped imports within `import () blocks`
25+
```
3126
3227
### Example
3328

0 commit comments

Comments
 (0)