当前位置:网站首页>错误:note: module requires Go 1.17

错误:note: module requires Go 1.17

2022-06-22 05:30:00 weixin_46272577

错误信息

PS D:\syz\study\computer_science\Go\workspaces\src\study-code\web_app> go run .\main.go
# golang.org/x/net/http2
..\..\..\pkg\mod\golang.org\x\[email protected]\http2\transport.go:416:45: und
efined: os.ErrDeadlineExceeded
note: module requires Go 1.17

通过提示,我需要下载 GO 1.17

下载 Go 1.17

需要设置 GOROOT 环境变量,取自己安装的文件夹即可。比如我把下载的 Go 1.17 放到了 Go 1.17 文件夹下。

image-20220605022210310

之后,打开 cmd,输入 go version,可以看到 Go 语言的版本

重新配置 GoLand

我是在 GoLand 下写项目的,而我的 GoLand 默认的 GOROOT 还是之前的老版本,所以我需要重新设置 GOROOT 路径。

此时运行程序就成功通过编译了

image-20220605022128985

原网站

版权声明
本文为[weixin_46272577]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_46272577/article/details/125128168