1、将项目克隆到非gopath的路径下
2、ide设置go module如图
3、在go命令行输入set GO111MODULE=on
4、go build main.go拉取依赖
错误解决:
1、exec: "gcc": executable file not found in %PATH%
这个是由于某个依赖包要求安装gcc导致的
解决办法:https://blog.csdn.net/benben_2015/article/details/80565676
扫描二维码关注公众号,回复:
8621498 查看本文章
2、$GOPATH/go.mod exists but should not
ide没有配置go module
解决办法:如上面第2步设置
3、cc1.exe: sorry, unimplemented: 64-bit mode not compiled in
没有安装64位的mingw
解决办法:windows: http://win-builds.org/doku.php/download_and_installation_from_windows