# go: go.mod has no module path

- **ID:** `go/module-directive-missing`
- **Domain:** go
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The go.mod file is missing the 'module' directive, which is required to define the module's import path.

## Version Compatibility

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

## Workarounds

1. **Add the module directive with the correct import path.** (95% success)
   ```
   Edit go.mod to include: 'module github.com/yourusername/yourproject' at the top.
   ```
2. **Reinitialize the module with 'go mod init'.** (90% success)
   ```
   Run 'go mod init github.com/yourusername/yourproject' to generate a proper go.mod.
   ```

## Dead Ends

- **Adding a random module path like 'module example' without proper naming.** — The module path should be a valid import path; random names cause issues later. (60% fail)
- **Deleting go.mod and running 'go mod init' without arguments.** — go mod init requires a module path; without it, it prompts for input. (70% fail)
