Skip to content

Commit ef7126f

Browse files
authored
Ignore flag handles type (#209)
1 parent fb6b442 commit ef7126f

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

output.go

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,20 @@ func printOutput(
142142
return false
143143
}
144144

145+
var inIgnoreTypes = func(node *callgraph.Node) bool {
146+
params := node.Func.Params
147+
if len(params) == 0 || params[0] == nil {
148+
return false
149+
}
150+
151+
for _, ignored := range ignorePaths {
152+
if params[0].Type().String() == ignored {
153+
return true
154+
}
155+
}
156+
return false
157+
}
158+
145159
var isInter = func(edge *callgraph.Edge) bool {
146160
//caller := edge.Caller
147161
callee := edge.Callee
@@ -208,7 +222,8 @@ func printOutput(
208222

209223
// ignore path prefixes
210224
if len(ignorePaths) > 0 &&
211-
(inIgnores(caller) || inIgnores(callee)) {
225+
(inIgnores(caller) || inIgnores(callee)) ||
226+
inIgnoreTypes(caller) || inIgnoreTypes(callee) {
212227
logf("IS ignored: %s -> %s", caller, callee)
213228
return nil
214229
}

0 commit comments

Comments
 (0)