diff --git a/src/sudo.bash b/src/sudo.bash index 40f8d1aa19..7b7d4f1cdd 100755 --- a/src/sudo.bash +++ b/src/sudo.bash @@ -12,6 +12,12 @@ Darwin) exit 0 esac +# Check that the go command exists +if ! go help >/dev/null 2>&1; then + echo "The go command is not in your PATH." >&2 + exit 2 +fi + eval $(go env) if ! [ -x $GOTOOLDIR/cov -a -x $GOTOOLDIR/prof ]; then echo "You don't need to run sudo.bash." >&2