如何在Go中表示实体之间的关系?

问题描述:

There is a large project on Golang which divided into many packages. I want to visualize the relationship between its entities to better understand the structure of the project. The first thing that comes to mind - the dependency graph classes. How to build it?

PS: And I want find all unused method's / structures

Golang上有一个大项目,分为多个软件包。 我想形象化其实体之间的关系,以更好地了解项目的结构。 想到的第一件事-依赖图类。 p>

PS: 我想找到所有未使用的方法/结构 p> div>

The tool closest to what you search (but without the diagram feature though) would be go oracle

It can be embedded in:

I also like to use test cases in order to compute a code coverage, which also helps to pinpoint unused methods.