Skip to content

Instantly share code, notes, and snippets.

@cbguder
Created February 27, 2016 00:39
Show Gist options
  • Save cbguder/091381149ae0564aa76f to your computer and use it in GitHub Desktop.
Save cbguder/091381149ae0564aa76f 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