mirror of
https://github.com/jimeh/dotfiles.git
synced 2026-02-19 12:06:41 +00:00
feat(golang): use goenv to install and manage Go versions
This commit is contained in:
@@ -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
|
||||
# ==============================================================================
|
||||
|
||||
Reference in New Issue
Block a user