# go: /path/go.mod: invalid module name: "example.com/" (trailing slash)

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

## Root Cause

The module directive in go.mod contains invalid characters or formatting errors, such as trailing slash.

## Version Compatibility

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

## Workarounds

1. **修正go.mod中的module名** (90% success)
   ```
   module example.com/myproject
# 移除尾部斜杠或非法字符
   ```
2. **使用go mod init重新初始化** (80% success)
   ```
   rm go.mod && go mod init example.com/myproject
   ```

## Dead Ends

- **删除go.mod文件** — 删除go.mod会导致模块系统失效，无法构建。 (80% fail)
- **复制其他项目的go.mod** — 模块名不匹配，会导致导入路径错误。 (90% fail)
