- 🔍 Real-time display of current Go version information
- 📋 Manage multiple installed Go versions
- ⬇️ Automatic download and installation of official releases
- 🔄 Quick switching between different Go versions
- ⚙️ Smart system environment variable management
- 💾 Support for environment configuration backup and restore
- 🔒 Secure environment variable rollback mechanism
- 🌐 Multi-architecture support (x86/x64/arm/arm64)
Download the latest version from the Releases page.
# Clone repository
git clone https://github.com/yuaotian/go-version-switch.git
cd go-version-switch
# Build
go build -o go-version-switch.exe ./cmd
# Add executable to PATH
# Recommended to copy the compiled file to C:\Program Files\go-version-switch\
# View help information
go-version-switch -h
# Check current version
go-version-switch -version
# List all installed versions
go-version-switch -list
# List all versions before update version list
go-version-switch -list -update
# Install specific version
go-version-switch -install 1.19.5
# Install specific version and architecture
go-version-switch -install 1.19.5 -arch x64
# Switch to specified version
go-version-switch -use 1.19.5
# Rollback environment variable configuration
go-version-switch -rollback
go-version-switch/
├── 📂 cmd/
│ └── main.go # Program entry
├── 📂 internal/
│ ├── config/ # Configuration management
│ │ └── config.go # Configuration handling
│ └── version/ # Version management
│ ├── common.go # Common functions
│ ├── download.go # Download functionality
│ ├── env.go # Environment variable handling
│ ├── goversion.go # Version information
│ ├── install.go # Installation logic
│ ├── list.go # Version listing
│ ├── releases.go # Release management
│ └── version.go # Version control
├── 📂 bin/
│ └── data/ # Runtime data
│ └── config/ # Configuration files
├── 📄 go.mod # Dependency management
├── 📄 go.sum # Dependency verification
└── 📝 README.md # Project documentation
- Windows 10/11
- Go 1.16+ (only for compilation)
- Administrator privileges (for modifying environment variables)
- Stable network connection (for downloading new versions)
-
Insufficient Permissions
Error: Administrator privileges required Solution: Run command prompt as administrator
-
Download Failure
Error: Download timeout Solution: Check network connection or use proxy
-
Version Switch Failure
Error: Environment variable update failed Solution: Use -rollback command to restore previous configuration
# Install dependencies
go mod download
# Run tests
go test ./...
# Build and test
go build -v -o bin/go-version-switch.exe ./cmd/main.go && ./bin/go-version-switch -install 1.23.4 -arch x86
- Fork the project
- Create your feature branch
- Commit your changes
- Push to the branch
- Create a Pull Request
- 🔐 Administrator privileges required for modifying system environment variables
- 🔄 Terminal or IDE restart required after version switch
- 💾 Regular backup of environment variable configuration recommended
⚠️ Ensure stable network connection- 📦 Do not manually modify the tool's data directory
- Search for existing issues before submitting a new one
- Provide detailed descriptions for Pull Requests
- Follow project code standards
- Ensure submitted code is tested
This project is licensed under the MIT License.