1

Using Go's documentation on managing Go installs, I have got two versions of Go on my system:

$ go version
go version go1.16.13 linux/amd64

$ go1.17 version
go version go1.17 linux/amd64

1.16 installed using Fedora's dnf and 1.17 using go install golang.org/dl/go1.17@latest; go1.17 download (I get it that latest 1.17 is 1.17.6, but that's OK for my purpose.)

In GoLand, I would like to use go1.17 to debug without modifying the system settings as a whole to use go1.17 every time I run a go command. I tried setting GOBIN=/home/<username>/go/bin/go1.17 in the Environment section of "Run/Debug Configurations", but that doesn't work (I'm not sure if it should.)

Is it possible to use a different Go version for debugging while using GoLand? How?

1 Answer 1

6

You can add your 1.16.13 Golang to the GoRoot setting from this path: settings/Go/GOROOT

see this picture enter image description here

after that, you can select The target version that you want to test. just need to select between 1.17 or 1.16 in this setting.

unfortunately, I didn't find any easier solution.

Sign up to request clarification or add additional context in comments.

2 Comments

Is it possible to have Goland recognise the version directly from go.mod file?
no, unfortunately! @Marko

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.