# Go: go: github.com/foo/bar@v1.2.3: invalid version: unknown revision v1.2.3

**Code:** `invalid version: unknown revision` · **Category:** Go · **Seen on:** Go, Git

Go cannot fetch the requested module version — the tag or branch doesn't exist, the repository is private or the proxy hasn't seen it yet.

## Meaning

Verify the tag exists on the remote and is pushed. For private repos, set `GOPRIVATE` and configure credentials. Newly pushed tags can lag in the proxy; retry or use `GOPROXY=direct`. Module paths with major version >= 2 need a `/v2` suffix.

## Common causes

- Tag not pushed or misspelled
- Private repo without credentials
- Proxy cache delay for new tags
- Wrong major-version path
- Retracted version

## Quick fix

1. `git ls-remote --tags <repo>` to confirm the tag
2. `GOFLAGS=-mod=mod GOPROXY=direct go get module@version`
3. Set `GOPRIVATE=github.com/yourorg/*`

## Detailed fix by platform

### Go

1. `go env -w GOPRIVATE=github.com/yourorg/*`

## How to diagnose

1. **Tag** — Exists remotely?
2. **Access** — Private?
3. **Path** — /v2 suffix?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/go/go-mod-invalid-version-unknown-revision)
