open-nomad/.semgrep/loopclosure.yml

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

29 lines
586 B
YAML
Raw Normal View History

rules:
- id: loopclosure
patterns:
- pattern-inside: |
for $A, $B := range $C {
...
}
- pattern-inside: |
go func() {
...
}()
- pattern-not-inside: |
go func(..., $B, ...) {
...
}(..., $B, ...)
- pattern-not-inside: |
go func() {
...
for ... {
...
}
...
}()
- pattern: $B
message: Loop variable $B used inside goroutine
languages:
- go
severity: WARNING