calleeObject resolves the object a call's callee denotes, whether the callee is a bare identifier (f()) or a selector (pkg.F() / recv.F()). Returns nil when info is unavailable or the callee has no resolvable object.
(info *types.Info, call *ast.CallExpr)
| 64 | // is a bare identifier (f()) or a selector (pkg.F() / recv.F()). Returns nil |
| 65 | // when info is unavailable or the callee has no resolvable object. |
| 66 | func calleeObject(info *types.Info, call *ast.CallExpr) types.Object { |
| 67 | if info == nil { |
| 68 | return nil |
| 69 | } |
| 70 | switch fun := call.Fun.(type) { |
| 71 | case *ast.SelectorExpr: |
| 72 | return info.Uses[fun.Sel] |
| 73 | case *ast.Ident: |
| 74 | return info.Uses[fun] |
| 75 | default: |
| 76 | return nil |
| 77 | } |
| 78 | } |
| 79 | |
| 80 | func osExecFuncName(obj types.Object) (string, bool) { |
| 81 | fn, ok := obj.(*types.Func) |
no outgoing calls
no test coverage detected