mirror of
https://github.com/kennyp/asdf-golang.git
synced 2024-10-05 12:12:06 +08:00
d4f1d65d59
* Create set-env.bash * Update README.md
18 lines
411 B
Bash
18 lines
411 B
Bash
asdf_update_golang_env() {
|
|
local go_bin_path
|
|
go_bin_path="$(asdf which go 2>/dev/null)"
|
|
if [[ -n "${go_bin_path}" ]]; then
|
|
abs_go_bin_path="$(readlink -f "${go_bin_path}")"
|
|
|
|
export GOROOT
|
|
GOROOT="$(dirname "$(dirname "${abs_go_bin_path}")")"
|
|
|
|
export GOPATH
|
|
GOPATH="$(dirname "${GOROOT}")/packages"
|
|
|
|
export GOBIN
|
|
GOBIN="$(dirname "${GOROOT}")/bin"
|
|
fi
|
|
}
|
|
asdf_update_golang_env
|