From c3fb7308d84d398731cbe38119d6ed13f0a0a572 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Fri, 17 Jun 2022 10:56:47 +0200 Subject: [PATCH] doc: mention how to generate a dependency graph Thanks @ainghazal for mentioning this useful tool to me! --- internal/README.md | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/internal/README.md b/internal/README.md index b075fac..b0c0a06 100644 --- a/internal/README.md +++ b/internal/README.md @@ -2,14 +2,26 @@ This directory contains private Go packages. -As a reminder, you can always check the Go documentation of -a package by using +## Useful commands + +You can read the Go documentation of a package by using `go doc -all`. + +For example: ```bash -go doc -all ./internal/$package +go doc -all ./internal/netxlite ``` -where `$package` is the name of the package. +You can get a graph of the dependencies using [kisielk/godepgraph](https://github.com/kisielk/godepgraph). + +For example: + +```bash +godepgraph -s -novendor -p golang.org,gitlab.com ./internal/engine | dot -Tpng -o deps.png +``` + +You can further tweak which packages to exclude by appending +prefixes to the list passed to the `-p` flag. ## Tutorials