MCPcopy
hub / github.com/docker/docker-agent / networkIOFuncName

Function networkIOFuncName

lint/constructor_network_io.go:64–87  ·  view source on GitHub ↗
(obj types.Object)

Source from the content-addressed store, hash-verified

62}
63
64func networkIOFuncName(obj types.Object) (string, string, bool) {
65 fn, ok := obj.(*types.Func)
66 if !ok {
67 return "", "", false
68 }
69 pkg := fn.Pkg()
70 if pkg == nil {
71 return "", "", false
72 }
73 name := fn.Name()
74 switch pkg.Path() {
75 case "net":
76 switch name {
77 case "Dial", "DialTimeout", "Listen", "ListenPacket", "ListenTCP", "ListenUDP", "ListenUnix":
78 return "net", name, true
79 }
80 case "net/http":
81 switch name {
82 case "Get", "Head", "Post", "PostForm":
83 return "http", name, true
84 }
85 }
86 return "", "", false
87}

Callers 1

networkIOCallFunction · 0.85

Calls 1

NameMethod · 0.65

Tested by

no test coverage detected