3 function __init_vim_go() {
7 mkdir -p "$HOME/.vim/pack/plugins/start"
8 rm -rf "$HOME/.vim/pack/plugins/start/vim-go"
9 git clone --depth=1 https://github.com/fatih/vim-go.git "$HOME/.vim/pack/plugins/start/vim-go"
11 # Install go linting tools
12 echo "Building go language tools..."
17 # Official Golang Tooling
19 go get golang.org/x/lint/golint@latest > /dev/null #2>/dev/null
21 go get golang.org/x/tools/gopls@latest > /dev/null #2>/dev/null
23 go get golang.org/x/tools/cmd/guru@latest > /dev/null #2>/dev/null
25 go get golang.org/x/tools/cmd/goimports@latest > /dev/null #2>/dev/null
27 go get golang.org/x/tools/cmd/gorename@latest > /dev/null #2>/dev/null
29 go get golang.org/x/tools/cmd/gotype@latest > /dev/null #2>/dev/null
31 echo -n "golangci-lint: "
32 go get github.com/golangci/golangci-lint/cmd/golangci-lint@latest > /dev/null #2>/dev/null
35 echo -n "fillstruct: "
36 go get github.com/davidrjenni/reftools/cmd/fillstruct@master > /dev/null #2>/dev/null
38 go get github.com/rogpeppe/godef@master > /dev/null #2>/dev/null
40 go get github.com/fatih/motion@master > /dev/null #2>/dev/null
42 go get github.com/kisielk/errcheck > /dev/null #2>/dev/null
44 go get github.com/go-delve/delve/cmd/dlv@master > /dev/null #2>/dev/null
46 go get github.com/koron/iferr@master > /dev/null #2>/dev/null
48 go get github.com/josharian/impl@master > /dev/null #2>/dev/null
50 go get honnef.co/go/tools/cmd/keyify@master > /dev/null #2>/dev/null
51 echo -n "gomodifytags: "
52 go get github.com/fatih/gomodifytags@master > /dev/null #2>/dev/null
54 go get github.com/klauspost/asmfmt/cmd/asmfmt@master > /dev/null #2>/dev/null
56 go get github.com/jstemmer/gotags > /dev/null #2>/dev/null
58 if [ -f "$HOME/.vimrc" ]; then
60 if ! grep 'source.*go.vim' -r ~/.vimrc; then
61 mkdir -p ~/.vim/plugins
62 printf '\n" Golang: reasonable defaults from webinstall.dev/vim-go\n' >> ~/.vimrc
63 printf 'source ~/.vim/plugins/go.vim\n' >> ~/.vimrc
68 if ! [ -f "$HOME/.vim/plugins/go.vim" ]; then
69 mkdir -p ~/.vim/plugins
70 WEBI_HOST=${WEBI_HOST:-"https://webinstall.dev"}
71 curl -fsS -o ~/.vim/plugins/go.vim "$WEBI_HOST/packages/vim-go/go.vim"
74 echo 'Running :GoInstallBinaries in vim ...'
75 printf ':GoInstallBinaries\n:q\n' | vim -e