mirror of
https://github.com/kennyp/asdf-golang.git
synced 2024-10-06 04:32:07 +08:00
21d9c329bb
Co-authored-by: Edwin Galdamez <egaldamez@gumgum.com>
12 lines
251 B
Bash
12 lines
251 B
Bash
asdf_update_golang_env() {
|
|
local go_path
|
|
go_path="$(asdf which go)"
|
|
if [[ -n "${go_path}" ]]; then
|
|
export GOROOT
|
|
GOROOT="$(dirname "$(dirname "${go_path:A}")")"
|
|
fi
|
|
}
|
|
|
|
autoload -U add-zsh-hook
|
|
add-zsh-hook precmd asdf_update_golang_env
|