# go: GOPATH not set, using default /home/user/go

- **ID:** `go/gopath-not-set`
- **Domain:** go
- **Category:** config_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

GOPATH environment variable is not set, Go uses default path which may cause unexpected module cache location.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.16 | active | — | — |
| 1.17 | active | — | — |

## Workarounds

1. **设置GOPATH环境变量** (90% success)
   ```
   export GOPATH=$HOME/go
echo 'export GOPATH=$HOME/go' >> ~/.bashrc
   ```
2. **使用go env设置** (80% success)
   ```
   go env -w GOPATH=$HOME/go
   ```

## Dead Ends

- **忽略警告继续开发** — 默认路径可能与其他工具冲突，或导致权限问题。 (40% fail)
- **设置GOPATH为当前目录** — GOPATH应该指向一个专用目录，而不是项目目录。 (70% fail)
