Created
May 1, 2019 11:12
-
-
Save rusq/785756b3655e4928d2fca67d7cf3e1c9 to your computer and use it in GitHub Desktop.
List all gofiles in current package without vendor subdirectory.
This file contains 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 | |
# List all gofiles with full path in the current package without vendor subdirectory. | |
# Useful for dependency tracking in Makefiles. | |
# License: WTFPL | |
go list -f "{{.Dir}}:{{.GoFiles}}" ./... \ | |
| tr -d '[]' \ | |
| awk 'BEGIN{FS=":"}{n=split($2,files," "); for (i=1; i<=n; i++) { printf ("%s/%s ",$1, files[i]); } ; };' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment