@@ -63,18 +63,27 @@ shirt -> sweater, not shirt -> tie -> sweater.
63
63
64
64
Example usage:
65
65
66
- Using digraph with existing Go tools :
66
+ Show which clothes (see above) must be donned before a jacket :
67
67
68
- $ go mod graph | digraph nodes # Operate on the Go module graph.
69
- $ go list -m all | digraph nodes # Operate on the Go package graph.
68
+ $ digraph reverse jacket
70
69
71
- Show the transitive closure of imports of the digraph tool itself:
70
+ Many tools can be persuaded to produce output in digraph format,
71
+ as in the following examples.
72
72
73
- $ go list -f '{{.ImportPath}} {{join .Imports " "}}' ... | digraph forward golang.org/x/tools/cmd/digraph
73
+ Using an import graph produced by go list, show a path that indicates
74
+ why the gopls application depends on the cmp package:
74
75
75
- Show which clothes (see above) must be donned before a jacket:
76
+ $ go list -f '{{.ImportPath}} {{join .Imports " "}}' -deps golang.org/x/tools/gopls |
77
+ digraph somepath golang.org/x/tools/gopls github.com/google/go-cmp/cmp
76
78
77
- $ digraph reverse jacket
79
+ Show which packages in x/tools depend, perhaps indirectly, on the callgraph package:
80
+
81
+ $ go list -f '{{.ImportPath}} {{join .Imports " "}}' -deps golang.org/x/tools/... |
82
+ digraph reverse golang.org/x/tools/go/callgraph
83
+
84
+ Using a module graph produced by go mod, show all dependencies of the current module:
85
+
86
+ $ go mod graph | digraph forward $(go list -m)
78
87
*/
79
88
package main // import "golang.org/x/tools/cmd/digraph"
80
89
0 commit comments