# go: github.com/foo/bar@v1.2.3: reading github.com/foo/bar/go.mod at revision v1.2.3: unknown revision v1.2.3

- **ID:** `go/go-mod-tidy-wrong-version`
- **Domain:** go
- **Category:** module_error
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

The requested module version does not exist in the remote repository, often due to a typo, tag mismatch, or missing tag.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| go1.21 | active | — | — |
| go1.22 | active | — | — |
| go1.23 | active | — | — |

## Workarounds

1. **Verify the tag exists in the remote repository using 'git ls-remote --tags https://github.com/foo/bar' and correct the version in go.mod.** (90% success)
   ```
   Verify the tag exists in the remote repository using 'git ls-remote --tags https://github.com/foo/bar' and correct the version in go.mod.
   ```
2. **Use 'go list -m -versions github.com/foo/bar' to list all available versions and choose a valid one.** (85% success)
   ```
   Use 'go list -m -versions github.com/foo/bar' to list all available versions and choose a valid one.
   ```

## Dead Ends

- **Running 'go clean -modcache' and retrying.** — The cache is not the issue; the version truly doesn't exist in the remote repo. (95% fail)
- **Adding a replace directive in go.mod pointing to a local path.** — This only works if the local path contains the correct code; it doesn't fix the remote version mismatch. (60% fail)
