🚀 Easily install and configure Golang on Linux, Mac, and Windows—fast and hassle-free!
wget https://raw.githubusercontent.com/kubex-ecosystem/gosetup/refs/heads/main/go.sh && bash gosetup.shbash <(curl -sL https://git.io/gosetup)git clone https://github.com/kubex-ecosystem/gosetup.git
cd gosetup
bash go.sh💡 Tip: By default, Go will be installed in
$HOME/.go, and$HOME/gowill be set as the workspace. You can customize these locations by settingGOROOTandGOPATHbefore installation:
export GOROOT=/opt/go
export GOPATH=$HOME/projects/go✅ Automatic installation & updates ✅ Specify a Go version to install ✅ Compatible with Windows, Linux, and macOS ✅ Smart environment configuration ✅ Supports multiple architectures (ARM, AMD64, i386) ✅ Seamless integration with GitHub Actions workflows
bash go.sh install.\go.ps1 -Command installbash go.sh install --version 1.19.4.\go.ps1 -Command install -Version 1.19.2bash go.sh check --version 1.19.4.\go.ps1 -Command check -Version 1.19.2bash go.sh remove.\go.ps1 -Command removebash go.sh help.\go.ps1 -Command helpEnsure a clean testing environment:
make test.\go.ps1 -Command test- ⭐ Star the repository to show support!
- 🔄 Fork and clone the repository.
- 🛠️ Create a new branch and make your changes.
- 📌 Submit a pull request and wait for review.
- 🎉 Join the community and stay updated!
The script follows these steps:
1️⃣ Detects your operating system and architecture.
2️⃣ Checks the latest available Go version.
3️⃣ Downloads & installs the correct version.
4️⃣ Sets up directories (GOROOT, GOPATH).
5️⃣ Adds Go binaries to PATH automatically.
6️⃣ Cleans up unnecessary files to keep things efficient.
Automate Go installation based on the version specified in go.mod:
- name: Install Go (Exact version from go.mod)
run: |
export NON_INTERACTIVE=true
bash -c "$(curl -sSfL 'https://raw.githubusercontent.com/kubex-ecosystem/gosetup/main/go.sh')" -s --version "$(grep '^go ' go.mod | awk '{print $2}')"🚀 **Simple. Fast. Powerful.** 🔥
