# go: module github.com/example/mod: not found in workspace

- **ID:** `go/dependency-not-found-in-workspace`
- **Domain:** go
- **Category:** module_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

When using Go workspaces (go.work), a required module is not listed in the workspace's go.work file.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.18 | active | — | — |
| 1.21 | active | — | — |
| 1.22 | active | — | — |

## Workarounds

1. **Add the module to the workspace's go.work file.** (95% success)
   ```
   Run 'go work use ./path/to/module' to include the module in the workspace.
   ```
2. **Initialize a new workspace with all modules.** (90% success)
   ```
   Run 'go work init' followed by 'go work use ./module1 ./module2' to add all modules.
   ```

## Dead Ends

- **Adding the module path to go.mod instead of go.work.** — go.work is separate from go.mod; the workspace must include the module. (90% fail)
- **Removing go.work and running without workspace.** — This may break other modules that depend on the workspace structure. (50% fail)
