Alistair Collins
Alistair Collins

Reputation: 2220

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?

Upvotes: 13

Views: 12214

Answers (3)

kristianp
kristianp

Reputation: 5895

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!

Upvotes: 2

Steve Perkins
Steve Perkins

Reputation: 11880

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.

Upvotes: 5

Mihai8
Mihai8

Reputation: 3147

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

Upvotes: 6

Related Questions