I'm using IntelliJ Idea, and the google-go-lang-idea-plugin from:
https://github.com/mtoader/google-go-lang-idea-plugin/issues/173
When I try to add my APT provided Go installation to the Go SDK list, I get the following error
I have tried adding the following directories as the Go SDK root
/usr/share/go/
/usr/share/src/
/usr/lib/go/
/usr/lib/go/src/
/usr/lib/go/pkg/
/usr/lib/go/pkg/linux_amd64
Does anyone know how to get this working? I've commented on the various issues in the bugtracker, however the maintainer claimed that this was fixed 10 months ago.
Failing that, does anyone know what this plugin is actually looking for that would make a directory look like the SDK directory?
I came this issue when config goroot path in goland idea.
I solve it as follows,
Go the GO SDK path and find zversion.go
, then append the file with
const TheVersion = `go1.17.2`
. You need to change the version according to you case.
In my case the sversion.go
path is located at D:\Programs\Go\src\runtime\internal\sys\zversion.go
.
Save the file, and restart the goland ide, then config the GOROOT (File -> setting -> Go -> GOROOT -> + -> local...), select you Go root path and save it.
It turns out that google-go-lang-idea-plugin
requires a slightly different folder structure than the default apt install produces. To fix it:
# mkdir /usr/lib/go/bin
# ln -s /usr/bin/go /usr/lib/go/bin/go
# ln -s /usr/bin/godoc /usr/lib/go/bin/godoc
# ln -s /usr/bin/gofmt /usr/lib/go/bin/gofmt
addon:
got the same problem on go1.18.4, just need to add this line of code in
${GOROOT}/src/runtime/internal/sys/zversion.go
const TheVersion = `go1.18`
So I just had this exact problem on IntelliJ 2016.1.3
with Go 1.5.
I had installed the IntelliJ Go Plugin a while ago and installed GO 1.5
a while back, and it all worked fine. Now i checked and suddenly, I'm sure I didn't remove it, GO 1.5 was gone from my system. But who knows, I haven't worked with go for a bit, so I might have removed it.
Anyway, after a bit of debugging, the following steps helped me:
1.6.3
). Follow the instructions on https://golang.org/doc/install
File -> Project Structure -> Project -> under Project SDK add a New SDK and navigate to your go installation
.Apply
and then Ok
Step 1: Open cmd
Step 2: Run below command => go env
Step 3: Find GOROOT and according this GOROOT path select directory for Go Sdk.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With