问题1 -go.mod 为空
go: go.mod file not found in current directory or any parent directory.
'go get' is no longer supported outside a module.
To build and install a command, use 'go install' with a version,
like 'go install example.com/cmd@latest'
For more information, see https://golang.org/doc/go-get-install-deprecation
or run 'go help get' or 'go help install'.
![](https://img2023.cnblogs.com/blog/1198450/202301/1198450-20230131121240118-494381760.png)
以为golang的版本升级问题, go.mod 为NUll 了。
使用 go env 查看 GOMOD=NUL
![](https://img2023.cnblogs.com/blog/1198450/202301/1198450-20230131121426374-1006950683.png)
进行设置一个路径即可
在go 文件夹下面创建了mod 文件。然后进行执行
go mod init mod
![](https://img2023.cnblogs.com/blog/1198450/202301/1198450-20230131121535058-1080659770.png)
查看成功,即可成功下载
![](https://img2023.cnblogs.com/blog/1198450/202301/1198450-20230131121552383-1017913503.png)
问题2 -超时
换个代理即可
go env -w GO111MODULE=on
go env -w GOPROXY=https://goproxy.cn,direct