Home > Article > Backend Development > Solve the problem that Go cannot be debugged after upgrading to 1.14
❝Debug is so important to a programmer, but after upgrading go1.14, my debug can no longer be used, which is very embarrassing. Encountered Problem solving problem.
❞
It is estimated that most people will encounter this problem in the future. Kaka has always insisted on using the latest version during the learning process.
Searching based on Kaka's current title, there are only a few articles analyzing it, but I couldn't implement the solution they gave me, so Kaka published an article to analyze this problem.
The most common solution is go get -u github.com/derekparker/delve/cmd/dlv
Execute this command. I don’t know why this command is not executed here. As a result, it is not downloaded, and the command ends after a while.
This problem is because this delve is not installed in version 1.14
Kaka is operated in windows, and the editor used is Goland.
Kaka’s GOROOT is in C:Go. If the picture provided by Kaka is missing any directory, please fill it in yourself
Just create the folders github.com/go-develThen execute under the go-devel foldergit clone https://github.com/derekparker/delve.git
After downloading, the following files will appear, and they are all in the delve folderFinally we need to use go install to install our package
Execute the commandgo install github. com/go-delve/delve/cmd/dlv
Here you need to see the directory structure clearly
After executing the command, a dlv executable program will be generated under GOPATH/bin. If there is no such file The installation fails. Look back and see where the operation is different from Kaka. Open the Goland editor, click according to the arrow prompt given by Kaka, then a create will pop up, click itThen enter the following contentdlv.path=C:/Go/bin/dlv .exe
is the executable program just installedAt this point all the work has been completed. Restart our Goland and take a look at the break point.
Go’s breakpoints still look very comfortable and very nice. This problem is perfectly solved
❝Persistence in learning, persistence in blogging, and persistence in sharing are the beliefs that Kaka has always upheld since his career. I hope that Kaka’s articles in Nuoda Internet can bring you a little bit of help .
❞
The above is the detailed content of Solve the problem that Go cannot be debugged after upgrading to 1.14. For more information, please follow other related articles on the PHP Chinese website!