mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 15:09:42 +00:00
40 lines
1.4 KiB
YAML
40 lines
1.4 KiB
YAML
tenets:
|
|
# Import effective Go bundle manually
|
|
- import: codelingo/effective-go/avoid-annotations-in-comments
|
|
- import: codelingo/effective-go/comment-first-word-as-subject
|
|
- import: codelingo/effective-go/good-package-name
|
|
- import: codelingo/effective-go/single-method-interface-name
|
|
- import: codelingo/effective-go/underscores-in-name
|
|
- import: codelingo/effective-go/unnecessary-else
|
|
- import: codelingo/code-review-comments/declare-empty-slice
|
|
- import: codelingo/effective-go/defer-close-file
|
|
- import: codelingo/effective-go/comment-first-word-when-empty
|
|
- name: missing-stop-ticker
|
|
actions:
|
|
codelingo/review:
|
|
comment: Add `defer {{varName}}.Stop()` to stop the ticker and release associated resources.
|
|
query: |
|
|
import codelingo/ast/go
|
|
|
|
go.func_decl(depth = any):
|
|
@review comment
|
|
go.assign_stmt(depth = any):
|
|
go.lhs:
|
|
go.ident:
|
|
sibling_order == 0
|
|
name as varName
|
|
go.rhs:
|
|
go.call_expr:
|
|
go.selector_expr:
|
|
go.ident:
|
|
name == "time"
|
|
go.ident:
|
|
name == "NewTicker"
|
|
exclude:
|
|
go.call_expr(depth = any):
|
|
go.selector_expr:
|
|
go.ident:
|
|
name == varName
|
|
go.ident:
|
|
name == "Stop"
|