Skip to content

Instantly share code, notes, and snippets.

@wheelq
Last active March 28, 2020 11:57
Show Gist options
  • Save wheelq/a3a19f4e6306976fc90cecd95353e137 to your computer and use it in GitHub Desktop.
Save wheelq/a3a19f4e6306976fc90cecd95353e137 to your computer and use it in GitHub Desktop.
Dockered go as an alias
#echo "alias go=' function __go(){ docker run --rm -v \"\${PWD}:/usr/src/myapp\" -w /usr/src/myapp -it golang:latest go \$@;unset -f __go;}; __go'"|tee -a ~/.bash_profile >> ~/.bashrc
echo -e "#\!/usr/bin/env bash\nfunction __go(){ docker run --rm -v \"\${PWD}:/usr/src/myapp\" -w /usr/src/myapp -it golang:latest go \$@;unset -f __go;}; __go \$@" > /usr/local/bin/go && chmod 755 /usr/local/bin/go
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment