-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot find package with 3 levels such as "github.com/golang/protobuf/proto" #24
Comments
The finding of packages in godepgraph is handled by the same functions used by the "go" command for compiling a package, so are you having the same problem when you run "go build github.com.coreos/etcd" ?? Specifically, as far as I can tell, godepgraph uses the "build environment" which looks at the binaries of the packages rather than the source of the packages, so you may need to use "go install" on the dependent packages first. I doubt it is related to the number of directory levels involved. |
@paulbuis You correct me with that |
You might want to look at the "go list" command to get the raw textual data for a dependency graph that does not come from analyzing the binaries for a package. I'm currently using the "-json" option as in "go list -json ./..." for the package in the current directory and then parsing the output into an array of nodes for the dependency graph. |
yes, this package was written quite a long time ago and uses much more primitive methods of traversing the dependency graph than are now available in Go. |
Tried and succeed just now. But the lines are too messy, any way to improve this? |
I just published a re-work of godepgraph at https://github.com/paulbuis/golistdepgraph that draws on execing "go list -json" for each package to get the dependency information and output it in a similar GraphViz dot format. It isn't thoroughly tested quite yet. It is also a bit slow because an "exec" is much slower than invoking one of the standard library "ImportXXX" methods. However, it does seem to handle things like vendoring and missing package sources reasonably well. |
You could always just use a copy of the code of |
The text was updated successfully, but these errors were encountered: