In Java/C++/C#, debuggers that come with fancy IDEs such as Visual Studio enable you to do a lot of amazing stuff: sprinkle breaking points all over the code, browse the address space and variable values during the execution and so on.
How to do these things in go? What tools can one use?
评论:
mdwhatcott:
SupersonicSpitfire:This blog post introduces godebug, which seems promising.
pseudomind:
space-llama:You may test out go-ide. IIRC it was super annoying to set up and use on OSX but, worked quite well on linux.
jerflang:I've gotten the most mileage from just having the vim-go plugin for vim. With the suggested key remappings I can jump deep into the code base very quickly. If you install Oracle you can also do some analysis like what things implement an interface and callers of a specific function. It's not a "fancy IDE" but it has almost all of the same capabilities. I mainly like being able to run go test on the test I'm currently writing and see a little pop up with the errors, if there are any.
Debugging a running program has become a little harder over the years. Delve is probably one of the better projects right now, though it has some odd bugs and behaviors. I used to use GDB but apparently it's development has halted in favor lldb, which doesn't seem to want to use the Go runtime debugging file that comes with Go. It's worth fiddling with some more since it's the most control you can have over your process without having to use a third party lib like godebugger (which is very new).
If you find anything that works well, please write back. I'm very interested in exploring proper debugging more.
staysafenerds:have you tried godebug?
dilatedmind:komodo ide
jetbrains go plugin
liteide or whatever its called?
if youre not using vim i think liteide is the best.