简体   繁体   中英

Debugging Go (golang) code in Windows

What is the best method of debugging go code in Windows?

https://stackoverflow.com/a/5514122/201618 states the GBD cannot be used as

Windows and ARM binaries do not contain DWARF debugging information and, as such, cannot be inspected with GDB.

https://stackoverflow.com/a/3405768/201618 implies that the best thing to do is just use fmt.Println

Is there a better current option? Is there a better planned future option?

In addition to GDB you can use Zeus . Also, take a look to comparison of IDEs for Google Go .

LiteIDE ( https://github.com/visualfc/liteide ) includes a build of GDB that works on Windows. When I experimented with Goclipse, I was able to point it to that GDB executable and debug applications just fine.

Delve supports windows and can be installed with the following command:

go get github.com/derekparker/delve/cmd/dlv

It has integration with code editors and IDEs such as VS code, Atom and IDEA. No Sublime Text support is available yet though!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM