2023-04-10 15:36:59 +00:00
|
|
|
# Copyright (c) HashiCorp, Inc.
|
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2022-02-03 22:33:07 +00:00
|
|
|
rules:
|
|
|
|
- id: "time-after-leak"
|
|
|
|
patterns:
|
|
|
|
- pattern: |
|
|
|
|
select {
|
|
|
|
case <- time.After(...): ...
|
|
|
|
}
|
|
|
|
message: "Potential leak of time.Timer, consider using NewSafeTimer instead"
|
|
|
|
languages:
|
|
|
|
- "go"
|
|
|
|
severity: "WARNING"
|
|
|
|
paths:
|
|
|
|
exclude:
|
|
|
|
- "testutil/*"
|
|
|
|
- "*testing.go"
|
|
|
|
- "*_test.go"
|