Comments (3)
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:
from go-callvis.
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:
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.
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)
- could not import XXXXX( invalid package name: "")
- Can go-callvis be used on windows platform? HOT 1
- Can't work on a program that doesn't have a main HOT 1
- Getting undeclared name when program builds perfectly HOT 3
- does not contain package
- panic: interface conversion: types.Type is nil, not *types.Signature HOT 6
- Support CGO, or the dependency graph stops at the CGO function instead of reporting an error HOT 1
- panic: in net/netip.AddrFromSlice: cannot convert *t0 ([]byte) to [4]byte HOT 9
- win11 -: package ; expected main packages contain errors!
- Panic: T for a simple programme HOT 1
- Problem during installation HOT 6
- Getting "no main packages" error HOT 1
- rebuild the application
- when a call 'go-callvis ... my flags' fails please give us a diagnostic message
- panic: T for Rta algo
- Unable to install on Mac M1 HOT 2
- Go-callvis analyze big repos is too slow, do you have any suggestions?
- [error]zsh: exec format error on MacOS
- Add support for graph database formats
- Installation is not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go-callvis.