A tool for installing or upgrading an existing go installation written in rust π₯
The only thing this does is follow the steps described at Go Installation. It is definitely not a replacement for a package manager or manual installation. It is intended for developers who enjoy using a Rust tool to install Go.
Download the precompiled binary from the releases.
go-installer
Note: This tool is originally developed for Linux amd64.
Fetch dependencies:
cargo update
To run for development:
cargo run
To run with specific flags, e.g., to use version 1.23.4 of Go:
cargo run -- --version 1.23.4
Requirements:
- Docker π³
- Docker Compose π
- At least 300MB for the Docker image and the download
We will use an isolated environment to test the tool without affecting the development computer. By default, DEBUG verbose level logging is enabled.
- Execute
test.sh
. - Once inside the Docker container, execute the following commands and take note:
- Check the current shell profile:
cat /etc/profile
- Check the binaries currently in the system:
ls /usr/local
- Run the installation process:
go-installer --version 1.23.4
- Verify that the PATH environment variable includes the Go bin path:
cat /etc/profile
- Confirm that the only change in the installation path
/usr/local
is the addition of thego
directory:
ls /usr/local
- Re-source the current shell:
source /etc/profile
- Check the Go version:
go version
The output should be 1.23.4. 8. Run the upgrade process to a new version:
go-installer --version 1.24.0
- Verify that the PATH environment variable still includes the bin path and that the line is not duplicated:
cat /etc/profile
- Confirm that the only change in the installation path
/usr/local
is the presence of thego
directory:
ls /usr/local
- Check the Go version again, which should now be 1.24.0:
go version
- Implement a working version of the tool
- Add a demo to the README.md
- Ask for confirmation before committing β
- Clean up the code π§Ή
- Automate QA π€
- Make shell PATH export configurable π§
- Automate the release process π
- Build multi-arch binaries ποΈ
- Get the latest version automagically πͺ