# Go Version Manager (Multi Go)

`gvm` stands for "Go Version Manager." It is a command-line tool that allows you to manage multiple versions of the Go programming language on your system. Go is known for its simplicity, performance, and efficiency in building scalable and concurrent applications. However, sometimes you might need to work with different versions of Go due to compatibility requirements or to test your code with different language versions.

`gvm` simplifies the process of installing, switching between, and managing multiple Go versions on your system. It provides an easy way to:

1. **Install Different Versions**: You can install various versions of Go side by side.
2. **Switch Between Versions**: `gvm` lets you switch between installed Go versions on demand, making it easy to work with different projects that might require different language versions.
3. **Set Environment Variables**: It automatically adjusts environment variables like `GOROOT` and `PATH` to ensure you're using the correct Go version.
4. **Install Packages**: You can install and manage packages for each version of Go independently.
5. **Update Go**: `gvm` can also help you update your installed Go versions.

Please note that while `gvm` is a convenient tool for managing multiple Go versions, there are other tools and methods available as well, such as manually installing Go versions or using other version managers. The specific choice depends on your preferences and needs.

***

**GVM Installation**

```
sudo apt-get update
sudo apt-get install curl git mercurial make binutils bison gcc build-essential bsdmainutils 
bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
```

**Installing Go & Using Go with GVM**

You can check all Go version available on <https://go.dev/dl/>

```
// You can check all Go version available on https://go.dev/dl/
// For example we will install Go version 1.19.12
gvm install go1.20

// Using the go1.20
gvm use go1.20
```

Please note that you can use and switch between all go installed easily, as you install more Go version in one server, it may need more spaces on your disk.

***

## Note for installing higher Go Version on GVM

if you need to install go1.24.1 for example, you need to install go1.20 first, then install go1.22, then install go1.23.7, then install 1.24.1

```
// install go1.20
gvm install go1.20
gvm use go1.20

// install go1.22
gvm install go1.22
gvm use go1.22

//install go1.23.7
gvm install go1.23.7
gvm use go1.23.7

//install go1.24.1
gvm install go1.24.1
gvm use go1.24.1

// after installing the version you need, just uninstall the other go version
gvm uninstall go1.23.7
gvm uninstall go1.22
gvm uninstall go1.20
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentation.codeblocklabs.com/other/gvm.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
