Skip to content
Iury O. G. Figueiredo edited this page Dec 30, 2019 · 2 revisions

This plugin implements basic keystrokes for easing the debugging process of Go applications. The aim of this plugin is providing a flexible approach for debugging your applications.

You will need to get Delve installed.

Check out:

https://github.com/go-delve/delve

For installing it in your system.

First steps

Open the files you wanna debug then switch to GOLANG mode by pressing:

<Key-numbersign>

That key is the one corresponding to '#' char.

Switch to the main package file then start the debugging process by pressing:

<Key-1>

In GOLANG mode. You will get a status bar message informing the debugger was started. You can check out the debugger output by pressing:

<Alt-q>

In GLOBAL mode. It means whatever the mode you're then that key will work. That will hold data on a text window, such a data would be coming from the debugger process.

Whenever you set a breakpoint, remove a breakpoint or send a command then the debugger will write its output to syslog window thus you can go keeping track of what is going.

Start a process with command line arguments

Sometimes you may need to drop arguments to the application, just press:

<Key-2>

In GOLANG mode, it will pop an input widget for you entering the program arguments.

Send a Delve command

Just press:

<Key-m>

In GOLANG mode.

Set a break point

Place the cursor at the line you want the debugger to stop on then press:

<Key-b>

Check whether the breakpoint was set by pressing:

<Alt-q>

Remove a breakpoint

Place the cursor over the line you want to remove the breakpoint then press:

<Control-c>

In GLOBAL mode.

Send continue

In order to stop at the next breakpoint, press:

<Key-c> 

in GOLANG mode. It sends a '(c)ontinue' to the debugger process.

Evaluate selected text in the current context

Select the expression you want to evaluate then press:

<Key-p>

In GLOBAL MODE. Once you have sentthe selected text then check the output by issuing:

<Alt-q>

Evaluate expression

When the debugger steps on a given breakpoint/line it may be good to evaluate some expressions to check what is going on. For such just press:

<Key-x>

Then enter your expression and hit return. You will be able to check the expression result by opening syslog window.

Restart Delve

Just hit:

<Key-r>

Terminate the process

Just hit:

<Key-Q> 
Clone this wiki locally