Last active
August 12, 2020 07:38
-
-
Save thanosp/5e7368fc7495d1766c9fd0d3639117bb to your computer and use it in GitHub Desktop.
shell function to find and go to the directory of a go project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# go to the source of a go project in $GOPATH | |
# Usage: $ figo projectname | |
figo () { | |
FIGODIR=`find $GOPATH/src -name "$1" -print -maxdepth 3 | grep -v vendor | head -n1` | |
if [ "$FIGODIR" = "" ]; then FIGODIR=`find $GOPATH/src -name "$1" -print -maxdepth 4 | grep -v vendor | head -n1`; fi | |
cd $FIGODIR | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment