Skip to content

Instantly share code, notes, and snippets.

@krishicks
Forked from xoebus/gist:571c6deb6db07364e8b7
Created August 4, 2015 02:19
Show Gist options
  • Save krishicks/de8c8d3849f642ba7c3f to your computer and use it in GitHub Desktop.
Save krishicks/de8c8d3849f642ba7c3f 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