windows下Go运行报错问题

技术
1 914
Y2020
Y2020 举报
2023-02-21

问题1:  

E:\go\code\gin_test>go run main.go

build command-line-arguments: cannot load io/fs: malformed module path "io/fs": missing dot in first path element

说是版本问题:

E:\go\code\gin_test>go version

go version go1.13.5 windows/amd64

解决方案:  升级到1.19版吧


倒序看帖 只看楼主
回帖
  • Goland  "The selected directory is not a valid home for Go Sdk"

    1. 在 golang 安装路径下寻找:

        'go1.17.2\src\runtime\internal\sys\zversion.go' 文件

    2. 打开 ‘zversion.go’ 文件,在其中追加如下行(你的版本号)并保存

        const TheVersion = `go1.17.2`

    3. 再次 配置 goland 的 GOROOT 路径,即可正常配置

    ————————————————


    0 举报 回复