With badly formed Go packages, this doesn't work:
go get -u
How do I clone
without go get
, and without manually parsing out the path?
With badly formed Go packages, this doesn't work:
go get -u
How do I clone
without go get
, and without manually parsing out the path?
Wrote this little shell function for my purposes, might prove useful to you too:
function glone()
{
IFS='/' read -r _ _ host team repo <<< "$1";
to_dir="${GOPATH:-$HOME/go}/src/$host/$team/$repo";
if ! [ -d "$to_dir" ]; then
mkdir -p "$to_dir";
git clone "$1" "$to_dir";
fi
cd "$to_dir";
}
Usage:
$ glone https://github.com/bradleyfalzon/gopherci