Skip to content

Instantly share code, notes, and snippets.

@jason-riddle
Last active January 5, 2019 06:34
Show Gist options
  • Select an option

  • Save jason-riddle/ba5532ef00504c3f85aa9330ed619858 to your computer and use it in GitHub Desktop.

Select an option

Save jason-riddle/ba5532ef00504c3f85aa9330ed619858 to your computer and use it in GitHub Desktop.
function print_fequency() {
(echo "Package Frequency" ; \
cat | tr ' ' '\n' | sort | uniq -c | awk '{print $2"\t"$1}') | column -t
}
# https://github.com/dominikh/go-unused
function find_unused() {
unused -exported "${1}/..."
}
# https://github.com/davecheney/prdeps
function count_deps() {
prdeps -d 1 -f "{{.ImportPath}}" -s "${1}" | print_fequency | grep -v /vendor/ | grep -v /_workspace/
}
# https://github.com/rogpeppe/showdeps
function show_deps() {
showdeps -T -from -stdlib -a -f "${1}/..."
}
# https://github.com/divan/depscheck
function check_deps() {
depscheck -v -internal "${1}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment