# go: 写入 go.sum: 打开 /path/to/go.sum: 权限被拒绝

- **ID:** `go/go-mod-file-permission-denied`
- **领域:** go
- **类别:** io_error
- **验证级别:** ai_generated
- **修复率:** 80%

## 根因

用户没有 go.sum 文件或其所在目录的写权限，通常在只读文件系统或 CI 环境中出现。

## 版本兼容性

| 版本 | 状态 | 引入 | 弃用 |
|------|------|------|------|
| 1.14 | active | — | — |

## 解决方案

1. **** (90% 成功率)
   ```
   Ensure the current user owns the directory: 'chown -R $USER:$USER /path/to/project' or run 'go mod tidy' in a writable location.
   ```
2. **** (85% 成功率)
   ```
   In CI, set the working directory to a writable path and copy go.mod/go.sum there.
   ```

## 无效尝试

- **** — This may change file ownership and cause later permission issues in CI or shared environments. (50% 失败率)
- **** — This is a security risk and may be reverted by version control systems. (30% 失败率)
