# Go toolchain mirror (pkg.shecan.ir)

> Mirror of dl.google.com/go (Go release archives, installers, source and their .sha256 files) and of the go.dev release list (/dl/?mode=json, /VERSION?m=text) for direct downloads, mise and goenv.

- Upstream: dl.google.com/go, go.dev/dl
- Mirror URLs: <https://mirror-golang.pkg.shecan.ir/go/>, <https://mirror-golang.pkg.shecan.ir/dl/?mode=json>
- Clients: curl, go, mise, goenv
- Service status: <https://pkg.shecan.ir/status.json> (key `golang`; up/down, refreshed every minute)
- Guide (Persian, HTML): <https://pkg.shecan.ir/mirrors/golang/>
- JSON: <https://pkg.shecan.ir/api/v1/mirrors/golang.json>
- Integrity comparison with the official source (audit.shecan.ir, also run by Shecan, open source; group `golang`, mirror `shecan`): <https://audit.shecan.ir/#golang>

## Limitations

- Go modules come from the separate GOPROXY mirror (mirror-go.pkg.shecan.ir); with GOPROXY set to it, GOTOOLCHAIN downloads of other Go versions also go through that mirror.
- The golang.org/dl wrappers (go1.X.Y download) and asdf-golang always download from dl.google.com; use GOTOOLCHAIN or mise instead.
- mise reads the list of Go versions from mise-versions.jdx.dev (or GitHub); only the archives come from the mirror.

## Setup

Every block below is the exact text of the Persian guide. Unless marked otherwise it is run against the live mirror in a disposable container on every catalog change; "checked by hand" blocks cannot run in a container. Change a machine only with its owner's permission: back up existing configuration first, merge into existing files instead of overwriting them, and keep the "Undo" step at hand.

### curl: temporary (one command or the current shell; nothing saved)

Run (linux)

```sh
V=$(curl -fsSL 'https://mirror-golang.pkg.shecan.ir/VERSION?m=text' | head -n1)
curl -fLO "https://mirror-golang.pkg.shecan.ir/go/$V.linux-amd64.tar.gz"
echo "$(curl -fsSL "https://mirror-golang.pkg.shecan.ir/go/$V.linux-amd64.tar.gz.sha256")  $V.linux-amd64.tar.gz" | sha256sum -c
```

Verify

```sh
curl -fsSL 'https://mirror-golang.pkg.shecan.ir/dl/?mode=json&include=all'
```

### go: temporary (one command or the current shell; nothing saved)

Run (linux, macos)

```sh
GOPROXY=https://mirror-go.pkg.shecan.ir GOTOOLCHAIN=go1.25.3 go version
```

### mise: persistent (user- or system-wide configuration)

Run (linux, macos)

```sh
export MISE_GO_DOWNLOAD_MIRROR=https://mirror-golang.pkg.shecan.ir/go
mise use -g go@1.25.3
```

Undo / restore the default (linux, macos)

```sh
unset MISE_GO_DOWNLOAD_MIRROR
sed -i.bak -E '/^export (MISE_GO_DOWNLOAD_MIRROR)=/d' ~/.bashrc ~/.zshrc ~/.profile 2>/dev/null || true
```

### goenv: persistent (user- or system-wide configuration)

Run (linux, macos) (checked by hand)

```sh
export GO_BUILD_MIRROR_URL=https://mirror-golang.pkg.shecan.ir/go
goenv install 1.25.3
```

Undo / restore the default (linux, macos)

```sh
unset GO_BUILD_MIRROR_URL
sed -i.bak -E '/^export (GO_BUILD_MIRROR_URL)=/d' ~/.bashrc ~/.zshrc ~/.profile 2>/dev/null || true
```
