gowrap
is a Go version management tool written in Go.
gowrap
tool consist of the following commands:
gowrap
: the command to manage installed versionsgo
: a wrapper for the Go'sgo
commandgofmt
: a wrapper for the Go'sgofmt
command
This is the main Go version management command. It will allow you installing,
uninstalling and configuring some preferences (such as setting up a default Go
version). For more help, run gowrap help
.
As a user of gowrap
tool, you should use wrapper commands (go
and gofmt
)
provided by this tool instead of directly executing specific versions of Go's
commands.
Wrapper commands will detect the most suitable Go version to use and they will call the desired specific version of the executed command.
In order to decide which version to use, wrapper commands will follow these rules:
- If current directory is part of a Go project:
- If
.go-version
exists in project root, it will select the version defined in that file as candidate. Otherwise, it will select the version defined ingo.mod
- If no matching version installed for selected version, it will suggest the user to install latest compatible version and use it
- If compatible versions are installed for selected version, it will use latest compatible version
- If
- If not in go project:
- If default version configured, it will use that version
- If no versions installed, it will suggest to install latest Go version and it will use it
- Otherwise, it will use latest installed Go version