paetzke/go-dep-graph — pull request #1 by lukechampine (2014-07-17 18:11:18+00:00)
Title: Fixes

A few fixes:
- The source directory is not stripped from the package name if it is not `GOPATH`. `main()` now sets the global variable `sourceDir` for each argument, and this string is trimmed from package names in `arrangeFilename()`.
- `handleImport()` was susceptible to out-of-bounds errors. It has been cleaned up a bit to use the strings library in a more idiomatic fashion.
- stdLib.go has been replaced with a simple function that recursively lists the packages in `GOROOT`.
- When the `-p` option is set, packages are only connected by a single arrow, making the graph much cleaner. It's possible that some people would want multiple arrows, but I think a single arrow should be the default. This could easily be moved to its own command line option.

Finally, I think 49d67a8 removes the need for any other processing in `arrangeFilename()`, but I didn't want to accidentally break anything. In my tests, removing lines 91-106 had no effect, but you should try it on your machine as well before removing it.