Skip to content

Instantly share code, notes, and snippets.

@sarathsp06
Last active August 29, 2015 14:24
Show Gist options
  • Save sarathsp06/30710cfa1749eaf7c4f8 to your computer and use it in GitHub Desktop.
Save sarathsp06/30710cfa1749eaf7c4f8 to your computer and use it in GitHub Desktop.
Golang - go get initializer tool gor private repositories in bitbucket
#!/usr/bin/env bash
set -o errexit
set -o pipefail
set -o nounset
args=("${@}")
package="${args[0]}"
echo -n "Enter your bitbucket username "
read user_name
if [ ! -d $GOPATH/src/${package} ];then
bitbucketUrl="https://${user_name}@${package}.git"
git clone $bitbucketUrl $GOPATH/src/${package}
fi
go get ${package}
@sarathsp06
Copy link
Author

Usage

bash goget-bitbucket.sh {packagename}

This will clone the repository into $GOPATH/src and do go get on the same again , this step is necessary only once then always one can use go get on the package for updates and so on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment