Skip to content
This repository has been archived by the owner on Jun 1, 2024. It is now read-only.

Commit

Permalink
added changes from jdx/mise#1638 (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdx authored Feb 9, 2024
1 parent 8bc7308 commit 50b74d1
Showing 1 changed file with 58 additions and 7 deletions.
65 changes: 58 additions & 7 deletions lang/go.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,71 @@ installed) and makes it the global default:
mise use -g [email protected]
```

Minor go versions 1.20 and below require specifying `prefix` before the version number because the first version
of each serie was released without a `.0` suffix, making 1.20 an exact version match:
Minor go versions 1.20 and below require specifying `prefix` before the version number because the
first version of each series was released without a `.0` suffix, making 1.20 an exact version match:

```sh
mise use -g go@prefix:1.20
```

## Configuration

- `MISE_GO_SKIP_CHECKSUM` [bool]: skips checksum verification of downloaded go tarballs, defaults to false
- `MISE_GO_DEFAULT_PACKAGES_FILE` [string]: location of default packages file, defaults to `$HOME/.default-go-packages`
- `MISE_GO_DOWNLOAD_MIRROR` [string]: location to download go from, defaults to `https://dl.google.com/go`
- `MISE_GO_SET_GOROOT` [bool]: set `$GOROOT` to the mise go installs go root dir, defaults to true
- `MISE_GO_SET_GOPATH` [bool]: set `$GOPATH` to the mise go installs packages dir, defaults to true
Set these with `mise settings set [VARIABLE] [VALUE]` or by setting the environment variable.

### `go_default_packages_file`

* Type: `string`
* Env: `MISE_GO_DEFAULT_PACKAGES_FILE`
* Default: `~/.default-go-packages`

Packages list to install with `go install` after installing a Go version.

### `go_download_mirror`

* Type: `string`
* Env: `MISE_GO_DOWNLOAD_MIRROR`
* Default: `https://dl.google.com/go`

URL to download go sdk tarballs from.

### `go_repo`

* Type: `string`
* Env: `MISE_GO_REPO`
* Default: `https://github.com/golang/go`

Used to get latest go version from GitHub releases.

### `go_set_gobin`

* Type: `bool | null`
* Env: `MISE_GO_SET_GOBIN`
* Default: `null`

Sets `GOBIN` to `~/.local/share/mise/go/installs/[VERSION]/bin`. This causes CLIs installed via
`go install` to have shims created for it which will have env vars from mise such as GOROOT set.

If not using shims or not using `go install` with tools that require GOROOT, it can probably be
safely disabled. See the [go backend](https://mise.jdx.dev/dev-tools/backends/) for the preferred
method to install Go CLIs.

### `go_set_gopath` <Badge type="warning" text="deprecated" />

* Type: `bool`
* Env: `MISE_GO_SET_GOPATH`
* Default: `false`

Sets `GOPATH` to `~/.local/share/mise/go/installs/[VERSION]/packages`. This retains behavior from
asdf and older mise/rtx versions. There is no known reason for this to be enabled but it is available
(for now) just in case anyone relies on it.

### `go_skip_checksum`

* Type: `bool`
* Env: `MISE_GO_SKIP_CHECKSUM`
* Default: `false`

Skips checksum verification of downloaded go tarballs.

## Default packages

Expand Down

0 comments on commit 50b74d1

Please sign in to comment.