Skip to content

Commit

Permalink
semgrep rule to prevent this kind of bug
Browse files Browse the repository at this point in the history
  • Loading branch information
tgross committed Feb 9, 2023
1 parent fdc9906 commit 25eb555
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .semgrep/protect_globals.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
rules:
- id: "no-overriding-struct-globals"
patterns:
- pattern: |
structs.$A = ...
message: "Mutation of global structs"
languages:
- "go"
severity: "ERROR"
fix: " "
paths:
# including tests!
include: ["*"]

0 comments on commit 25eb555

Please sign in to comment.