#!/usr/bin/env bash SRC_DIR=$1 if [ ! -e "$SRC_DIR/src/all.bash" ] then echo "\`$SRC_DIR' is not top directory of go source code" exit 1 fi pushd "$SRC_DIR" find src -name "*.go" | \ etags --language=none \ --regex='/type[ \t]+[^ \t]+[ \t]/' \ --regex='/func[ \t]+[^( \t]+[( \t]/' \ --regex='/func[ \t]+([ \t]*[^( \t]*[ \t]+\*?\([^) \t]+\)[ \t]*)[ \t]*\([^( \t]+\)[( \t]/\1.\2/' - find src -name "*.[hc]" | etags -a - find src -name "*.goc" | etags --language=c -a - find src -name "*.s" | etags -a --language=none \ --regex='/TEXT [^(]+/' - find include -name "*.h" | etags -a - popd