dotfiles/devel/go.sh

40 lines
674 B
Bash
Raw Normal View History

#!/bin/sh
DIR=$(dirname "$(readlink -f "$0")")
. "$DIR/../env.sh"
log "Setting up go"
# install go
2021-09-16 14:18:49 +00:00
2021-11-10 13:00:57 +00:00
if ! has_cmd go; then
case "$PM" in
2021-09-16 14:18:49 +00:00
pkg)
pkg install golang -y
;;
apt)
sudo apt install -y \
golang
;;
pacman)
sudo pacman -S --noconfirm --needed \
go
;;
esac
2021-11-10 13:00:57 +00:00
fi
if in_china; then
go env -w GO111MODULE=on
2021-08-26 15:20:52 +00:00
go env -w GOPROXY=https://goproxy.io,direct
fi
# coc.nvim
if enhance_vim; then
v -c "CocInstall -sync coc-go|qall"
fi
2021-08-28 09:55:01 +00:00
# air for autoreload webapp
echo Download air for autoreload webapp
echo https://github.com/cosmtrek/air/releases/latest
echo and store to ~/go/bin