On Fri, Sep 2, 2016 at 1:20 PM, Davis Ford <davisf...@gmail.com> wrote:
> Does anyone know of a tool that can analyze dependencies and print a graph,
> specifically as it relates to golang vendor'd libraries.  I'm using 1.7 and
> most tools don't seem to be able to produce results on a project that is
> using vendor'd dependencies.

Something like the following chunk of Bash would work (you could tweak
the Go list  invocation to just do vendored deps probably) if you have
graphviz installed (I can't remember where I got this, appologies if
I'm cribbing a script out of someones presentation without proper
attribution):

    % ( echo "digraph G {"; \
    %   go list -f '{{range .Imports}}{{printf "\t%q -> %q;\n" \
    %     $.ImportPath .}}{{end}}' \
    %     $(go list -f '{{join .Deps " "}}' YOURPACKAGE) YOURPACKAGE;
\
    %   echo "}";
    % ) | dot -Tsvg -o $@

—Sam


-- 
Sam Whited
pub 4096R/54083AE104EA7AD3

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to