Last active
June 2, 2016 21:50
-
-
Save mem/99179b9e0d01e0b58f7b0c03666a511a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Given a package's import path, this script will list the Go sources (not in $GOROOT) | |
# used to build that pacakge. | |
go list -f '{{ join .Deps "\n" }}' "$@" | | |
xargs -r -d '\n' \ | |
go list -f '{{ if not .Goroot }}{{ .ImportPath }}{{ end }}' 2> /dev/null | | |
xargs -r -d '\n' \ | |
go list \ | |
-f '{{ $d := .Dir }}{{ range .GoFiles }}{{ $d }}/{{ . }}{{ "\n" }}{{ end }}' \ | |
"$@" | | |
sort -u |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment