goland 配置go1.18 时报错“the selected directory is not a valid home for Go SDK ”
网上解决1.17版时的办法也不行,去官方社区才在一个旧版本的解决方案中找到靠谱的方法。
依然是修改 /usr/local/go/src/runtime/internal/sys/zversion.go 文件。
新增三行
const defaultGoroot = `/usr/lib/golang`const theVersion = `go1.18`var buildVersion = theVersion
win版如果有类似问题也可以试试如此处理,区别只是路径不同。