Comments (8)
Thanks a lot for your answer. I tried a lot of other packages afterwards, all worked fine. Then I suddenly realized that the ko package I was initially investigating was a generated code. :-( the worst one to pick. :-(
So, all good now. Thanks again for your help.
BTW, the graph I sent before, http://img.vim-cn.com/a3/c9865f9ef44f1994b760bb3c5c058c37838df0.png, was generated using go's native callgraph
command, before I knew of go-callvis. There were much tedious manual cleanup afterward, that's why I'm interested in the automatically way provided by go-callvis. Thanks again for providing that.
from go-callvis.
Main package is required for the analysis used, because all the calls in the callgraph tree begins in main (and inits).
In package you don't really know what will be called, since it's just a package without some start point. Program that will use the package can call anything or nothing.
from go-callvis.
Ok. Thanks.
from go-callvis.
Reopening the issue as I'm still unable to visualize call graph for Go libs, despite I've given it some start point:
go-callvis -group pkg,type -limit github.com/knq/xo github.com/knq/xo/examples/sqlite3 | dot -Tpng -o /tmp/out.png
and the result looks like this:
http://img.vim-cn.com/32/9823a165bf43ec1ce6fa5cacfee09b663543fe.png
I.e., the visualization is only limited within the "examples/sqlite3", but not down to the xo lib level, which is what I had hoped for, when using the -limit github.com/knq/xo
parameter.
As a comparison, here is what the level of details of xo lib call graph I'm hoping to see --
http://img.vim-cn.com/a3/c9865f9ef44f1994b760bb3c5c058c37838df0.png
So it is possible then? Thanks.
from go-callvis.
By default the -focus
flag is set to main so it only shows calls from and to that package.
You can use an empty string (-focus=""
) to show all the calls for the program. Although I warn you that it might generate huge output if you don't use -limit
or -nostd
.
from go-callvis.
Thanks a lot for your answer.
So I tried it:
go-callvis -group pkg,type -focus="" -limit github.com/knq/xo github.com/knq/xo/examples/sqlite3 | dot -Tpng -o /tmp/out.png
however, the result is almost like what I posted before:
http://img.vim-cn.com/70/d93fee55166de1f43504fd87e901b79c4fa7f7.png
Do you have a full command like above that I can try out myself please? It'd be great if you have and can try with any of the following packages:
github.com/andybalholm/cascadia/
github.com/beevik/etree/
github.com/deckarep/golang-set/
github.com/fatih/camelcase/
github.com/gnewton/chidley/
github.com/goji/
github.com/moovweb/gokogiri/
github.com/spf13/cobra/
github.com/zenazn/goji/
Or any smaller but useful packages that you have locally.
Thanks
from go-callvis.
I have tried project cobra's program github.com/spf13/cobra/cobra using:
go-callvis -group pkg -focus="" -limit github.com/spf13/cobra github.com/spf13/cobra/cobra | dot -Tpng -o cobra.png
Output:
Are you looking for something like this?
I don't really know what happens inside github.com/knq/xo/examples/sqlite3
since it's not published, but could it be that the output you got from go-callvis has the only calls that happen for that example (for github.com/knq/xo path prefix)?
from go-callvis.
By the way, what did you use to generate the graph you sent before? http://img.vim-cn.com/a3/c9865f9ef44f1994b760bb3c5c058c37838df0.png
from go-callvis.
Related Issues (20)
- 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
- Installation not working HOT 2
- Compilation warnings on macOS 14.0 with Apple M2 chip HOT 3
- Got error running go-callvis on github.com/googlecloudplatform/gcsfuse HOT 4
- "ent.withHooks$1: cannot convert *t0 (M) to PM"
- Link to Github pages is broken
- Not linking caller to callee in a goroutine
- Visualizing Specific Functions or Receivers
- warning: implicit truncation from 'int'
- Internal panic in pointer analysis HOT 1
- Machine readable output
- internal error in pointer analysis: runtime error: invalid memory address or nil pointer dereference
- panic: runtime error: invalid memory address or nil pointer dereference [recovered] HOT 2
- quick question: is go-callvis thread-safe? HOT 1
- README to explain `<target package>` HOT 1
- Temporary SVG file cannot be rewritten on Windows
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.