Skip to content

Instantly share code, notes, and snippets.

@xoebus
Created August 4, 2015 02:17
Show Gist options
  • Save xoebus/571c6deb6db07364e8b7 to your computer and use it in GitHub Desktop.
Save xoebus/571c6deb6db07364e8b7 to your computer and use it in GitHub Desktop.
function goto() {
local p
local f
for p in `echo $GOPATH | tr ':' '\n'`; do
f=`find ${p}/src -maxdepth 3 -type d | grep ${1} | head -n 1`
if [ -n "$f" ]; then
cd $f
return
fi
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment