Skip to content

Instantly share code, notes, and snippets.

@wadey wadey/godeps.zsh
Created Aug 25, 2015

Embed
What would you like to do?
godeps
#!/bin/zsh
typeset -A DONE
_dep() {
go list -f "{{if not .Standard}}{{printf \"\t%q -> %q;\n\" \"$1\" .ImportPath}}{{end}}" "$2"
}
_graph() {
if [ -z ${DONE[$1]} ]
then
DONE[$1]="done"
for d in $(go list -f '{{if not .Standard}}{{join .Imports " "}}{{end}}' "$1")
do
_dep "$1" "$d"
_graph "$d"
done
fi
}
echo "digraph G {"
_graph "$1"
echo "}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.