mirror of
https://github.com/kennyp/asdf-golang.git
synced 2024-10-06 04:32:07 +08:00
Add dynamic GOROOT setting for fish (#103)
This commit is contained in:
parent
3c3674a10c
commit
9f07a48cc1
@ -32,6 +32,9 @@ To set `GOROOT` in your shell's initialization add the following:
|
||||
**zsh shell**
|
||||
`. ~/.asdf/plugins/golang/set-env.zsh`
|
||||
|
||||
**fish shell**
|
||||
`. ~/.asdf/plugins/golang/set-env.fish`
|
||||
|
||||
## When using `go get` or `go install`
|
||||
|
||||
After using `go get` or `go install` to install a package you need to run `asdf reshim golang` to get any new shims.
|
||||
|
8
set-env.fish
Normal file
8
set-env.fish
Normal file
@ -0,0 +1,8 @@
|
||||
function asdf_update_golang_env --on-event fish_prompt
|
||||
set --local go_path (asdf which go)
|
||||
if test -n "$go_path"
|
||||
set --local full_path (builtin realpath "$go_path")
|
||||
|
||||
set -gx GOROOT (dirname (dirname "$full_path"))
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue
Block a user