Handle no go version set case (#132)

This commit is contained in:
Andy Jones 2024-04-19 13:15:44 +01:00 committed by GitHub
parent e6edd35384
commit 652c592264
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -1,5 +1,5 @@
function asdf_update_golang_env --on-event fish_prompt
set --local go_path (asdf which go)
set --local go_path (asdf which go 2>/dev/null)
if test -n "$go_path"
set --local full_path (builtin realpath "$go_path")

View File

@ -1,6 +1,6 @@
asdf_update_golang_env() {
local go_path
go_path="$(asdf which go)"
go_path="$(asdf which go 2>/dev/null)"
if [[ -n "${go_path}" ]]; then
export GOROOT
GOROOT="$(dirname "$(dirname "${go_path:A}")")"