Skip to content

Instantly share code, notes, and snippets.

@wweir
Last active June 5, 2020 11:13
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wweir/78ea25df5f0d9b6a9e2acc7ab031efee to your computer and use it in GitHub Desktop.
Save wweir/78ea25df5f0d9b6a9e2acc7ab031efee to your computer and use it in GitHub Desktop.
利用 goproxy 加速安装 gopls 之类命令行工具,并保持开发环境整洁
#!/usr/bin/env bash
god(){
mkdir -p /tmp/god
(cd /tmp/god && go mod init god &> /dev/null)
for repo in $@; do
(cd /tmp/god && GOPROXY=${GOPROXY:-https://goproxy.cn,direct} go get $repo)
done
}
god $@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment