GithubHelp home page GithubHelp logo

Charting goreleaser about go-callvis HOT 3 CLOSED

ofabry avatar ofabry commented on September 1, 2024
Charting goreleaser

from go-callvis.

Comments (3)

suntong avatar suntong commented on September 1, 2024 1

Oh, that's the trick. Thanks a lot for the comprehensive explanation, and the wiki example too!

So, FTA, this works,

go-callvis -group pkg,type -focus="" -limit github.com/goreleaser $gpkg | dot -Tpng -o ~/screenshot.png

and generated this chart:

chart

from go-callvis.

suntong avatar suntong commented on September 1, 2024

Oh, is it because all non-public functions & types are ignored?

I even tried this:

go-callvis -group pkg,type -nostd $gpkg | dot -Tpng -o ~/out.png

But the result is still rather limited:

nostd

If so, the non-public functions & types are equally important (besides the public ones) for people to understand the package, when they are trying to how how things related, which is what go-callvis for and why they are using it.

Please consider adding a switch to output those.
Thx.

from go-callvis.

ondrajz avatar ondrajz commented on September 1, 2024

I think I know why you might be confused. I will try to explain.

Both of your examples show expected output. Keep in mind that this tool only shows function calls. For example it won't show types, variables or constants. It can only show relation to a type if its method is called.

I assume that by non-public functions you meant unexported. The output always shows both unexported and exported functions. Currently there isn't any flag to omit them. In the Reference guide you can see the difference in visualization of those functions.

In your examples you can clearly see unexported function init calling anonymous function init#1. The reason why you don't see any calls from the main package to some unexported function inside other package is because that's impossible in Go, since unexported functions can only be called inside package.

The important flag which controls what is shown in the output is -focus flag. By default it is set to main, that means it will only show function calls from and to the main package. If you want to show calls inside other package you can use -focus flag to change the shown package.

You can find more thorough explanation in the wiki: https://github.com/TrueFurby/go-callvis/wiki/Focusing-packages

from go-callvis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.