Здесь не с golang надо разбираться. А как настраивать переменные окружения в MacOs.
У меня на Linux, в оболочке Fish, такие настройки:
if status is-interactive
# commands to run in interactive sessions can go here
set -gx GOPATH $HOME/Code/golang/gosdk
set -gx GOBIN $GOPATH/bin
set -gx PATH $GOBIN $PATH
set -gx PATH $PATH /home/dp/.cargo/bin
end
set -gx EDITOR hx
set -gx VISUAL hx
set -gx COLORTERM truecolor
abbr -a -- ra ranger
abbr -a -- py python
abbr -a -- jo joshuto
# asdf configuration code
if test -z $ASDF_DATA_DIR
set _asdf_shims "$HOME/.asdf/shims"
else
set _asdf_shims "$ASDF_DATA_DIR/shims"
end
# do not use fish_add_path (added in Fish 3.2) because it
# potentially changes the order of items in PATH
if not contains $_asdf_shims $PATH
set -gx --prepend PATH $_asdf_shims
end
set --erase _asdf_shims