在goload 中执行代码报错

$GOPATH/go.mod exists but should not goland

方法1 将go目录下存在go.mod,删去

方法2 goland Go Modules设置

$GOPATH/go.mod exists but should not goland
GOPATH不设置留空,保留Default
$GOPATH/go.mod exists but should not goland
系统变量添加GOPROXY,值:https://goproxy.cn
$GOPATH/go.mod exists but should not goland

相关文章: