add README with disclaimer
[misc.git] / go-imports
1 #!/bin/sh
2
3 # A simple script to list all imports within one or more directories
4 # containing Go source code.
5
6 if test -z "$1"
7 then
8         echo >&2 "usage: go-imports DIRECTORY"
9         exit 1
10 fi
11
12 find "$@" -name '*.go' | xargs awk '/import \(/,/\)/ { print $NF }' | tr -d '()"' | sort -u