想把自定义的目录加到 GOROOT里 自以为是 用分号隔开 配置多个 go env -w GOROOT="/usr/local/go;/path/project" linux 多个应该用 冒号 分隔 结果运行报错 go run main.go go: cannot find GOROOT directory: /usr/local/go;/path/project export GOROOT=/usr/local/go echo $GOROOT /usr/local/go go run main.go Don't panic. go env -w GOROOT="/usr/local/go" go env