(p *cop.Pass, call *ast.CallExpr)
| 48 | } |
| 49 | |
| 50 | func networkIOCall(p *cop.Pass, call *ast.CallExpr) (string, string, bool) { |
| 51 | if pkg, name, ok := networkIOFuncName(calleeObject(p.Info, call)); ok { |
| 52 | return pkg, name, true |
| 53 | } |
| 54 | |
| 55 | if name, ok := cop.CallTo(call, "net", "Dial", "DialTimeout", "Listen", "ListenPacket", "ListenTCP", "ListenUDP", "ListenUnix"); ok { |
| 56 | return "net", name, true |
| 57 | } |
| 58 | if name, ok := cop.CallTo(call, "http", "Get", "Head", "Post", "PostForm"); ok { |
| 59 | return "http", name, true |
| 60 | } |
| 61 | return "", "", false |
| 62 | } |
| 63 | |
| 64 | func networkIOFuncName(obj types.Object) (string, string, bool) { |
| 65 | fn, ok := obj.(*types.Func) |
no test coverage detected