Skip to content

Instantly share code, notes, and snippets.

@NZSmartie
Created February 17, 2018 01:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NZSmartie/58b1598ea6c006de441df03ba88ff14e to your computer and use it in GitHub Desktop.
Save NZSmartie/58b1598ea6c006de441df03ba88ff14e to your computer and use it in GitHub Desktop.
Becausse Go doesn't support command aliasing... 🤬
# TODO: Get latest release, not aa fixed version
sudo wget https://github.com/golang/dep/releases/download/v0.4.1/dep-linux-amd64 -O /usr/bin/go-dep
sudo chmod u=rwx,go=rx /usr/bin/go-dep
cat > $HOME/.bashrc <<EOL
# Alias 'go dep' to go-dep
go() {
if [[ $@ == dep\ * ]]; then
command go-dep $(echo "$@" | cut -c 5-)
else
command go "$@"
fi
}
EOL
# To take affect, log out and log in. or type `source ~/.bashrc`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment