最近重新搞go项目,在我新mac上启动时候遇到引入包一直报红色提醒,于是记录一下问题
遇见的问题有:
无法解析目录:Cannot resolve directory 'xxx.xxx'
在使用go mod ticl命令一直超时:go-lang:dial tcp 172.217.160.81:443: i/o timeout
设置报错warning: go env -w GOPROXY=... does not override conflicting OS environm
等。。。
其实都是源于GOPATH设置的问题,我的解决如下:
在GoLand-->选择Preferencese(mac 快捷键com+,)-->Go-->Go Modules
在Environment里填入GOPROXY=https://goproxy.cn,direct再Apply应用即可,所需的包即可导入
附上其他参考文章:
dial tcp 172.217.24.17:443: connect: connection refused问题解决
go-lang: dial tcp 172.217.27.145:443: i/o timeout
GOLand设置报错warning: go env -w GOPROXY=... does not override conflicting OS environm