Goenv

发布时间 2024-01-02 20:41:56作者: ZhangZhihuiAAA

 

git clone https://github.com/go-nv/goenv.git ~/.goenv

 

echo 'export GOENV_ROOT="$HOME/.goenv"' >> ~/.bashrc

echo 'export PATH="$GOENV_ROOT/bin:$PATH"' >> ~/.bashrc

echo 'eval "$(goenv init -)"' >> ~/.bashrc

 

zzh@ZZHPC:~$ goenv init -
export GOENV_SHELL=bash
export GOENV_ROOT=/home/zzh/.goenv
if [ "${PATH#*$GOENV_ROOT/shims}" = "${PATH}" ]; then
  export PATH="$PATH:$GOENV_ROOT/shims"
fi
source '/home/zzh/.goenv/libexec/../completions/goenv.bash'
command goenv rehash 2>/dev/null
goenv() {
  local command
  command="$1"
  if [ "$#" -gt 0 ]; then
    shift
  fi

  case "$command" in
  rehash|shell)
    eval "$(goenv "sh-$command" "$@")";;
  *)
    command goenv "$command" "$@";;
  esac
}
goenv rehash --only-manage-paths