ondrajz / go-callvis

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

need generic example #55

Open marcelloh opened 4 years ago

marcelloh commented 4 years ago

I tried a lot of the examples, and bend them to my needs, but none of them generates an image that represents the software. I don't even know if it is needed that the software to be analyzed, should be in a GOPATH?

I haven't got that, so I'm not sure.... I do like this: go-callvis -group pkg,type -nostd ./... But I just got a main that has 2 childs (1 being error and 1 being the initialize)

How can I make a picture that covers my whole project? (I did I misunderstood and isn't the tool capable of doing so?)

arush-sal commented 4 years ago

Soo.. you must be seeing something like below:

Screenshot from 2019-12-20 00-53-42

and it shows correctly because you only have a single call in main package. Something like:

func main() {
    cmd.Execute()
}

run the go-callvis with -group pkg,type then you will be able to click on packages in the browser to switch focus to a different one. And that's how you do it.

Found the answer in their slack by @Ondrej Fabry

marco-m commented 4 years ago

@arush-sal

run the go-callvis with -group pkg,type then you will be able to click on packages in the browser to switch focus to a different one.

thanks! That made the trick for me also :-)

unknwon commented 4 years ago

In case anyone ends up here as I am. the [cmd] in the graph is clickable! Boom, amazing!

den-is commented 4 years ago

Jesus...... README.md or examples should clearly state that PACKAGE in the light yellow >SQUARES< are clickable, hehe

ondrajz commented 4 years ago

Jesus...... README.md or examples should clearly state that PACKAGE in the light yellow >SQUARES< are clickable, hehe

Done. https://github.com/ofabry/go-callvis#features

joshua0x commented 3 years ago

@ofabry can we start analysis from any function instead of main (package main ) ?