(pass *analysis.Pass, call *ast.CallExpr, ctx txContext, suppressed map[int]bool)
| 151 | } |
| 152 | |
| 153 | func reportCallMisuse(pass *analysis.Pass, call *ast.CallExpr, ctx txContext, suppressed map[int]bool) bool { |
| 154 | kind, pos := classifyCall(pass, call, ctx.outerStore) |
| 155 | switch kind { |
| 156 | case misuseDirect: |
| 157 | reportIfNotSuppressed(pass, suppressed, pos, fmt.Sprintf( |
| 158 | "outer store '%s' used inside InTx; use transaction store '%s' instead", |
| 159 | ctx.outerStore.display, |
| 160 | ctx.txName, |
| 161 | )) |
| 162 | return true |
| 163 | case misusePassThrough: |
| 164 | reportIfNotSuppressed(pass, suppressed, pos, fmt.Sprintf( |
| 165 | "outer store '%s' passed as argument inside InTx; use transaction store '%s' instead", |
| 166 | ctx.outerStore.display, |
| 167 | ctx.txName, |
| 168 | )) |
| 169 | return true |
| 170 | default: |
| 171 | return false |
| 172 | } |
| 173 | } |
| 174 | |
| 175 | func funcLitCall(call *ast.CallExpr) (*ast.FuncLit, bool) { |
| 176 | funcLit, ok := unparen(call.Fun).(*ast.FuncLit) |
no test coverage detected