V
V
Valeriy Solovyov2014-10-29 12:24:28
go
Valeriy Solovyov, 2014-10-29 12:24:28

How to build dependency graph of golang code?

There is a project with several thousand code in golang (not mine). Code in various packages.
And even now it is difficult to understand what dependencies are in the methods and methods that are not used .
A dependency graph for Go would be very helpful.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
SilentFl, 2014-10-30
@SilentFl

if there was no testing in the project (*_test.go files), then, probably, nothing but pens and eyes.
but if there are tests, we make a testing profile and look at the results:

go test -coverprofile=c.out github.com/user/project
go tool cover -func=c.out

although, if there are no tests, then you can simply write stub tests for all functions, and it will already be clear what is used and what is not

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question