open-vault/tools/semgrep/ci/loop-time-after.yml

20 lines
413 B
YAML

# Copyright (c) HashiCorp, Inc.
# SPDX-License-Identifier: MPL-2.0
rules:
- id: loop-time-after
pattern: |
for ... {
...
select {
case ...
case <-time.After(...):
...
case ...
}
...
}
message: <-time.After() used in for loop, consider using a ticker or a timer instead
languages:
- go
severity: WARNING