# Go Modules

Avrea caches Go modules so that `go mod download` resolves from colocated cache
on repeat runs.

## On Avrea runners

The module proxy is pre-configured:

```bash
GOPROXY="https://cache.avrea.com:8443/gomod/,direct"
```

Your workflow needs no changes:

```yaml title="workflow.yml"
jobs:
  build:
    runs-on: avrea-ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-go@v7
        with:
          go-version: '1.25'
          cache: false  # Use Avrea build cache instead
      - run: go build ./...
```

## Manual setup

```bash
export GOPROXY="https://cache.avrea.com:8443/gomod/,direct"
```

The `,direct` suffix ensures that if a module is not available through the cache,
Go falls back to fetching directly from the source.