# go: cannot find main module; see 'go help modules'
	current directory is outside of any module
	no go.mod file found in /home/user/project or any parent directory

- **ID:** `go/missing-go-mod-file`
- **Domain:** go
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The current working directory does not contain a go.mod file, and no parent directory has one, so Go cannot determine the module context.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.11 | active | — | — |
| 1.12 | active | — | — |
| 1.13 | active | — | — |
| 1.14 | active | — | — |
| 1.15 | active | — | — |
| 1.16 | active | — | — |
| 1.17 | active | — | — |
| 1.18 | active | — | — |
| 1.19 | active | — | — |
| 1.20 | active | — | — |
| 1.21 | active | — | — |
| 1.22 | active | — | — |
| 1.23 | active | — | — |

## Workarounds

1. **Initialize the module with 'go mod init'** (95% success)
   ```
   go mod init example.com/project
   ```
2. **Navigate to a directory that contains a go.mod file** (90% success)
   ```
   cd /path/to/valid/module && go build
   ```

## Dead Ends

- **Creating a go.mod file with arbitrary content** — The module path must be correct; arbitrary content may cause import resolution failures. (70% fail)
- **Setting GO111MODULE=off to use GOPATH mode** — If the project is not in GOPATH, it still fails; also disables modern module features. (60% fail)
