Skip to content

Instantly share code, notes, and snippets.

@twotwotwo
Last active August 29, 2015 14:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save twotwotwo/68f8d133c665a07e2b67 to your computer and use it in GitHub Desktop.
Save twotwotwo/68f8d133c665a07e2b67 to your computer and use it in GitHub Desktop.
'net' with deepest occurrence of each pkg only
If you take the full `net` tree, for each package find the deepest
level of tree where it appears, and delete other imports of that
package that are nearer the root, you get something like:
net
os
io
errors
time
syscall
sync
runtime
sync/atomic
math/rand
math
sort
Yay: preserves the depth, still a tree so no tangle of arrows.
Boo: hides most of the relationships, like net imports sync.
If same pkg's imported twice at same depth, you're stuck picking arbitrarily
which import to show.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment