Install g on Linux/macOS
masterYou can install g automatically using a shell script. It is recommended to clear GOROOT, GOBIN, and other Go-related environment variables before installation to avoid conflicts.
Automated Installation
Run the following commands in bash or zsh:
# Install g
curl -sSL https://raw.githubusercontent.com/voidint/g/master/install.sh | bash
# Optional: Unalias 'g' if it is already used by another command
cat << 'EOF' >> ~/.bashrc
if [[ -n $(alias g 2>/dev/null) ]]; then
unalias g
fi
EOF
# Load the environment
source "$HOME/.g/env"curl -sSL https://raw.githubusercontent.com/voidint/g/master/install.sh | bash