ondrajz / go-callvis

Visualize call graph of a Go program using Graphviz
https://ofabry.github.io/go-callvis
MIT License
5.91k stars 408 forks source link

init() of blanked imports are ignored #26

Open Nhoya opened 6 years ago

Nhoya commented 6 years ago

Hi, I have a project that contains multiple imported packages, some of them are blanked because I'm using only the init() function, the problem is that in go-callvis they are not displayed. I use

go-callvis -group type,pkg ../myproject |dot -Tpng -o out.png

I'm missing something?

ondrajz commented 6 years ago

Hey, there is a -focus flag which by default uses main package to focus only on calls going from or to that package. That's why you don't see those init() functions from other packages.

You could try focusing on the package that has the init() you are interested it. However you could also checkout the recent enhancement for go-callvis, currently opened in PR.

The call graph output is now served via HTTP server in SVG format and you can click on packages to change focus.