(expr ast.Expr)
| 534 | } |
| 535 | |
| 536 | func rootIdentAndSuffix(expr ast.Expr) (*ast.Ident, string, bool) { |
| 537 | switch expr := unparen(expr).(type) { |
| 538 | case *ast.Ident: |
| 539 | return expr, "", true |
| 540 | case *ast.SelectorExpr: |
| 541 | ident, suffix, ok := rootIdentAndSuffix(expr.X) |
| 542 | if !ok { |
| 543 | return nil, "", false |
| 544 | } |
| 545 | return ident, suffix + "." + expr.Sel.Name, true |
| 546 | default: |
| 547 | return nil, "", false |
| 548 | } |
| 549 | } |
| 550 | |
| 551 | func callReceiver(call *ast.CallExpr) ast.Expr { |
| 552 | selector, ok := unparen(call.Fun).(*ast.SelectorExpr) |
no test coverage detected