dotfiles/zsh/funcs/gopls

10 lines
No EOL
226 B
Text

local GO_BIN="$(go env GOPATH)/bin"
if [[ ! -d "${GO_BIN}" ]]; then
mkdir -p "${GO_BIN}"
fi
if [[ ! -a "${GO_BIN}/gopls" ]]; then
pushd "${GO_BIN}"
GO111MODULE=on go get golang.org/x/tools/gopls@latest
popd
fi