Version of Delve is too old for Go version 1.20.0 (maximum supported version 1.19)
Asked Answered
D

8

9

When start debbugging session in GoLand I get this error:

WARNING: undefined behavior - version of Delve is too old for Go version 1.20.0 (maximum supported version 1.19)

I reinstall it with JetBrains Toolbox and didn't work. I uninstall it and install it manualy and didn't work!

The IDE maintainers say that GoLand didn't update delve when updating the IDE version in SOME CONDITIONS!

Director answered 27/2, 2023 at 21:35 Comment(5)
Have you tried installing a newer version of delve?Hardwick
No, there is no doc on JetBrains to update it in GoLand. If you have a resource to do it please provide me with it.Director
Please download EAP version of GoLand (jetbrains.com/go/nextversion). It contains the latest version of Delve.Davedaveda
Thanks But, it is stable?Director
It is in Beta right now, so pretty stable. Alternatively, you can update Delve using following workaround: youtrack.jetbrains.com/issue/GO-14287/…Davedaveda
D
7

I was using GoLand 2022.3.2, recently 2022.3.3 was released and I update it to the latest version, and the issue was resolved.

I don't think it solves the problem entirely and I may hit it again in the future. So, I hope they fix it in a complete manner.

Director answered 10/3, 2023 at 17:0 Comment(0)
T
7

I found this workaround from the official issue.

  1. Install dlv binary with go install github.com/go-delve/delve/cmd/dlv@latest
  2. Set the dlv.path=<path_to_dlv_executable> under Help > Edit Custom Properties
  3. Restart GoLand

It works for me.

Tale answered 11/1 at 20:4 Comment(0)
O
5

Firstly install the latest version of delve based on the instructions here, https://github.com/go-delve/delve/tree/master/Documentation/installation

# Install the latest release:
$ go install github.com/go-delve/delve/cmd/dlv@latest

After installing the latest version of dlv, identify the path of the dlv executable file,

which dlv
# Output: /Users/<username>/go/bin/dlv

In your debug console check for the path that is used for running dlv /Users/<username>/Library/Application Support/JetBrains/IntelliJIdea2022.1/plugins/go/lib/dlv/macarm/dlv

Goto to the above path and follow the below steps,

mv dlv dlv.old # If the dlv is present 
ln -s /Users/<username>/go/bin/dlv dlv

Now you can rerun the application and you should be able to get the debugger working.

Overgrow answered 12/12, 2023 at 9:0 Comment(0)
C
2

I solved this issue in this way:

go install github.com/go-delve/delve/cmd/dlv@latest

(first make a copy of the original dlv.exe)

copy '%homepath%\go\bin\dlv.exe' to 'C:\Program Files\JetBrains\goland-2022.1.4.win\plugins\go\lib\dlv\windows\dlv.exe' restart GolandIDE

Coquetry answered 2/10, 2023 at 13:45 Comment(0)
I
1

You can either install the latest version of goland or upgrade only the dlv. For the latter, download source code from here and run go install pathToYourDownloadedPackage/cmd/dlv

Idola answered 7/3, 2023 at 8:19 Comment(1)
Please read the post comments, there is no doc on JetBrains to update delve in GoLand.Director
P
0

I was having the same problem. Updating the Goland version solved my problem.

Make sure you've fully updated your IDE by following these commands: Help -> Check for updates.

Pokpoke answered 23/5, 2023 at 19:40 Comment(0)
T
0

In ubuntu, if you install goland by jetbrains toolbox, you can upgrade goland dlv with following commands:

go install github.com/go-delve/delve/cmd/dlv@latest                     # download and compile latest version dlv
p=~/.local/share/JetBrains/Toolbox/apps/goland/plugins/go/lib/dlv/linux # goland dlv binary location
$p/dlv version                                # check older version                                     
mv $p/dlv $p/dlv.old && mv $GOPATH/bin/dlv $p # move to upgrade
$p/dlv version                                # check newer version
Tarango answered 22/2 at 1:58 Comment(0)
B
0

I have same problem, and I have solved it by replacing the DLV bound to Goland with a 1.8.0 support Golang 1.16 DLV version.

  1. download an older dlv version supporting your golang version, such as: my golang is 1.16 and dlv use this delve1.8.0

  2. complie dlv:

cd <downloadDir>/cmd/dlv 
go build
  1. edit goland properties: Help > Edit Custom Properities..., and add
dlv.path=<yourPath>/cmd/dlv/dlv
Birdt answered 12/3 at 11:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.