Files
dotfiles/zsh/golang.zsh
Jim Myhrberg 2a0ae3af05 feat(golang): remove use of goenv
It's simpler to just have a single version of Go available, with goenv
lots of different modules/packages which have `.go-version` files, the
LSP server doesn't work correctly unless the specific version of Go is
installed.
2020-11-26 15:42:57 +00:00

39 lines
1.0 KiB
Bash
Executable File

#
# Go (golang) environment setup.
#
# ==============================================================================
# global golang packages
# ==============================================================================
install_go_global_packages() {
local packages=(
github.com/akavel/up
github.com/asciimoo/wuzz
github.com/cweill/gotests/...
github.com/go-delve/delve/cmd/dlv
github.com/golang/mock/gomock
github.com/golang/mock/mockgen
github.com/kisielk/errcheck
github.com/mdempsky/unconvert
github.com/rogpeppe/godef
golang.org/x/lint/golint
golang.org/x/tools/cmd/godoc
golang.org/x/tools/cmd/goimports
golang.org/x/tools/cmd/guru
golang.org/x/tools/gopls
mvdan.cc/gofumpt
mvdan.cc/gofumpt/gofumports
)
for package in "${packages[@]}"; do
echo "installing/updating \"$package\""
GO111MODULE=on go get -u "$package"
done
if command-exists goenv && [ "$(goenv version-name)" != "system" ]; then
echo "running: goenv rehash..."
goenv rehash
fi
}