# go: parsing go.mod: unexpected module path "example.com/foo"

- **ID:** `go/go-mod-replace-directive-error`
- **Domain:** go
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The go.mod file has a syntax error, often in a replace directive where the module path is not properly quoted or malformed.

## Version Compatibility

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

## Workarounds

1. **** (90% success)
   ```
   Check the go.mod file for any misplaced characters or newlines; use 'go mod edit -fmt' to format it correctly.
   ```
2. **** (85% success)
   ```
   If the error is in a replace directive, ensure the syntax is 'replace module => replacement' with correct paths.
   ```

## Dead Ends

- **** — Module paths in go.mod are not quoted; adding quotes will cause a different parsing error. (80% fail)
- **** — This may break builds if the replace was needed for local development. (40% fail)
