The selected directory is not a valid home for Go SDK

安装完毕Go和GoLand之后,重新配置GoLand的GOROOT时,可能会报错

The selected directory is not a valid home for Go SDK

需要找到安装Go的目录,我的目录如下
D:\SoftFolder\Go\src\runtime\internal\sys

进入到sys文件下,找到zversion.go,并打开,输入如下字符(要直接复制,容易有字符不符合要求)
 

const TheVersion = `go1.x.x`

其中go.1.x.x是Go的版本号,如我的是go1.21.6,可以在命令行输入
go env
得到。
The selected directory is not a valid home for Go SDK_第1张图片

你可能感兴趣的:(Go,golang,开发语言,后端)