我正在跑步:
当我使用以下GOPATH时:
$GOPATH=C:\Users\marc\Desktop\coding\go
我尝试使用命令
直接从VIM-go
运行Go程序
:GoRun
我收到以下错误:
go: GOPATH entry is relative; must be absolute path: "C".
当我改变我的去路径时:
$GOPATH = /Users/marc/Desktop/coding/go
:GoRun
命令工作正常,但go install
引发了以下错误:
go install: no install location for directory C:\Users\marc\Desktop\coding\go\src\github.com\marc\test outside GOPATH
For more details see: go help gopath
那么$GOPATH
应该具有哪些值才能使两个命令都正常工作?
---我找到了答案---
我以为我为遇到同样问题的人发布我的解决方案。将GOPATH改为:
$GOPATH = /C/Users/marc/Desktop/coding/go