You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When installing in a brand new environment, it will rely on the go command.
The code is from .gvm/scripts/install, and when the script executes the compile_go method, it requires that the go command has already been installed in the system.
If you use this script on a system where no version of go has been installed, it will not be able to run.
compile_go() {
display_message " * Compiling..."# Test for Windowscase"$(uname)"in*MINGW* | *WIN32* | *CYGWIN*)
MAKE_SCRIPT=make.bat
;;
*)
MAKE_SCRIPT=make.bash
;;
esac
[ -z"$GOROOT_BOOTSTRAP" ] &&export GOROOT_BOOTSTRAP=$(go env GOROOT) 《-- this line
unset GOARCH &&unset GOOS &&unset GOPATH &&unset GOBIN &&unset GOROOT &&export GOBIN=$GO_INSTALL_ROOT/bin &&export PATH=$GOBIN:$PATH&&export GOROOT=$GO_INSTALL_ROOT&&if [ !-f"$GO_INSTALL_ROOT/VERSION" ];thenecho"$GO_NAME">"$GO_INSTALL_ROOT/VERSION";fi&&#builtin cd $GO_INSTALL_ROOT/src && ./all.bash &> $GVM_ROOT/logs/go-$GO_NAME-compile.log ||builtincd"$GO_INSTALL_ROOT/src"&& chmod -f +x $MAKE_SCRIPT&& ./$MAKE_SCRIPT&>"$GVM_ROOT/logs/go-$GO_NAME-compile.log"||
(rm -rf "$GO_INSTALL_ROOT"&& display_fatal "Failed to compile. Check the logs at $GVM_ROOT/logs/go-$GO_NAME-compile.log")
}
It's recommended to check if the go command exists in the environment before installation, and only then use the go env GOROOT command to initialize the GOROOT_BOOTSTRAP variable.
The text was updated successfully, but these errors were encountered:
When installing in a brand new environment, it will rely on the
go
command.The code is from .gvm/scripts/install, and when the script executes the compile_go method, it requires that the go command has already been installed in the system.
If you use this script on a system where no version of
go
has been installed, it will not be able to run.It's recommended to check if the
go
command exists in the environment before installation, and only then use thego env GOROOT
command to initialize theGOROOT_BOOTSTRAP
variable.The text was updated successfully, but these errors were encountered: