Created
September 15, 2020 15:36
-
-
Save mark-rushakoff/65d587799de9f3f353055333ed907807 to your computer and use it in GitHub Desktop.
Find packages that are declared in your project but not referenced anywhere
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
go list -test ./... | sort -u > /tmp/full_list_with_tests | |
go list -test -json ./... | jq -r '.Deps | map(select(startswith("github.com/YOUR/PROJECT/"))) | join("\n")' | sort -u > /tmp/is_depended_with_tests | |
comm -23 /tmp/full_list_with_tests /tmp/is_depended_with_tests | grep -v '.test$' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment