Created
November 4, 2016 17:36
-
-
Save ericychoi/24a44ac2a5c48980a1bf720d742262e5 to your computer and use it in GitHub Desktop.
Go Get using Git Clone
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
# use git clone to clone the go repo to the right location in your gopath | |
function goget() { | |
# github.com/foo/bar | |
GIT_PATH="$@" | |
# git@github.com:foo/bar.git | |
GIT_CLONE_PATH=`echo "$GIT_PATH" | perl -lape 's!(.+?)/!git\@$1:!'` | |
mkdir -p "$GOPATH/src/$GIT_PATH" && git clone "$GIT_CLONE_PATH" "$GOPATH/src/$GIT_PATH" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment