go-callvis
go-callvis copied to clipboard
README to explain `<target package>`
Seems like a great tool but the "quick start" in the README needs some work. It's not explained well esp. what is <target package>. It's also not very clear how it works with (just uses Go source files I think) and that it runs a webserver to serve the results (by default). (This was on Windows but I'll also try Linux when I get my Ubuntu laptop working.)
I also googled and checked the Github issues but still could not get it to work.
I tried various things with these errors (cmd shell and git-bash):
go-callvis main # -: package main is not in std (D:\Golang\go1.21.6\src\main)
$ go-callvis main # -: package main is not in GOROOT (C:\Program Files\Go\src\main)
$ go-callvis main.go # C:\Program Files\Go\src\internal\abi\abi.go:117:19: undeclared name: any + 100s more errors
$ go-callvis github.com/
$ go-callvis github.com/
$ go-callvis test.exe # -: no required module provides package test.exe
There were also other suggestions in other issues for the README. (I'd be happy to update the README once I work out how to use it :)
I got it to work with go 1.18. Then working backwards now have it working with 1.21.6. Long story but when running in git-bash it is picking up the std library files from C:\Program Files\Go\src\ (which has 1.18 source code) due to GOROOT.
In summary, I believe <target package> is not the package but the module name, or (if there is only one .go file in the package) the name of the .go file.
Thanks for raising this issue! I agree that the current usage of go-callvis can be unclear. I'll work on improving the CLI and adding detailed examples to the README to make it more user-friendly. Your feedback is very helpful and appreciated.
if you use ./... as target package it will attempt to run, list found packages within the project, with which you can use to invoke the tool against on a subsequent run.