M install.sh => install.sh +1 -1
@@ 1,3 1,3 @@
#!/bin/sh
-stow --verbose --dotfiles --target="$HOME" zsh git configs vim
+stow --verbose --dotfiles --target="$HOME" zsh git configs vim plugins
A plugins/dot-set-go-env.sh => plugins/dot-set-go-env.sh +13 -0
@@ 0,0 1,13 @@
+# https://go.dev/doc/gopath_code
+# https://github.com/kennyp/asdf-golang/pull/56
+
+asdf_update_golang_env() {
+ local go_root
+ go_root="$(asdf where golang)"
+ if [[ -n "${go_root}/go" ]]; then
+ export GOROOT
+ GOROOT="${go_root}/go"
+ fi
+}
+autoload -U add-zsh-hook
+add-zsh-hook precmd asdf_update_golang_env
M zsh/dot-zshrc => zsh/dot-zshrc +1 -2
@@ 104,8 104,7 @@ export RIPGREP_CONFIG_PATH=~/.ripgreprc
export PKG_CONFIG_PATH="/opt/homebrew/lib/pkgconfig:$PKG_CONFIG_PATH"
# go
-# https://go.dev/doc/gopath_code
-export GOPATH="$HOME/Code/go"
+source ~/.set-go-env.sh
### Local overrides ###