trailofbits.go.sleep-used-for-synchronizations.sleep-used-for-synchronizations

Author
232
Download Count*
License
Using time.Sleep
for synchronizations is generally considered bad practice.
Run Locally
Run in CI
Defintion
rules:
- id: sleep-used-for-synchronizations
patterns:
- pattern-either:
- pattern: |
...
go func(...) {
...
}(...)
time.Sleep(...)
...
- pattern: |
...
go $FOO(...)
time.Sleep(...)
...
- pattern-inside: func $FUNC(...){ ... }
message: Using `time.Sleep` for synchronizations is generally considered bad
practice.
languages:
- go
severity: WARNING
metadata:
license: CC-BY-NC-SA-4.0
Short Link: https://sg.run/YXK4