Skip to content

Instantly share code, notes, and snippets.

@derekwaynecarr
Created October 8, 2014 17:54
Show Gist options
  • Save derekwaynecarr/0cbeba5b08e12619cf92 to your computer and use it in GitHub Desktop.
Save derekwaynecarr/0cbeba5b08e12619cf92 to your computer and use it in GitHub Desktop.
# Use go get to get the specified dependency
dependency=$1
echo "Getting new dependency ${dependency}"
if ! go get "${dependency}" ; then
echo "ERROR: Unable to get new dependency via 'go get'"
exit 1
fi
# Use godep to save new dependency
echo "Saving dependencies ..."
godep restore
if ! godep save ./... ; then
echo "ERROR: Unable to save new dependencies. If packages are listed as not found, try fetching them via 'go get'"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment