# Go mirror (pkg.shecan.ir)

> GOPROXY mirror of proxy.golang.org for the go command, including the sum.golang.org checksum database.

- Upstream: proxy.golang.org, sum.golang.org
- Mirror URL: <https://mirror-go.pkg.shecan.ir/>
- Clients: go, docker
- Service status: <https://pkg.shecan.ir/status.json> (key `go`; up/down, refreshed every minute)
- Guide (Persian, HTML): <https://pkg.shecan.ir/mirrors/go/>
- JSON: <https://pkg.shecan.ir/api/v1/mirrors/go.json>

## Limitations

- Public modules only; list private modules in GOPRIVATE so go fetches them directly.
- The checksum database is fetched through the mirror and still verified by go; GOSUMDB and GONOSUMDB need no change.

## 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.

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

Run (linux, macos)

```sh
GOPROXY=https://mirror-go.pkg.shecan.ir go mod download golang.org/x/text@v0.20.0
```

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

Run

```sh
go env -w GOPROXY=https://mirror-go.pkg.shecan.ir,direct
```

Undo / restore the default

```sh
go env -u GOPROXY
```

### go, docker: project (files inside the project)

Configuration file, Dockerfile based on the official golang image: `Dockerfile`

```dockerfile
FROM mirror-docker.pkg.shecan.ir/golang:1.23
ENV GOPROXY=https://mirror-go.pkg.shecan.ir,direct
RUN go mod download golang.org/x/text@v0.20.0
```
