feat(golang): use goenv to install and manage Go versions

This commit is contained in:
2020-09-27 18:33:31 +01:00
parent 85b13ba7e7
commit be4c3e1599
2 changed files with 35 additions and 4 deletions

View File

@@ -2,6 +2,37 @@
# Go (golang) environment setup.
#
# ==============================================================================
# goenv
# ==============================================================================
# install goenv
zinit ice wait lucid as'program' pick'bin/goenv' from'gh' \
atclone'src/configure && make -C src' atpull'%atclone' nocompile'!'
zinit light syndbg/goenv
zinit ice wait lucid as'program' pick'plugins/go-build/bin/go-build' from'gh' \
id-as'syndbg/go-build'
zinit light syndbg/goenv
# lazy-load goenv
goenv() {
load-goenv
goenv "$@"
}
_goenv() {
load-goenv
_goenv "$@"
}
compctl -K _goenv goenv
load-goenv() {
unset -f load-goenv _goenv goenv
eval "$(command goenv init -)"
}
# ==============================================================================
# global golang packages
# ==============================================================================