# Tips for debugging Go in an IDE

**URL:** <https://forum.golangbridge.org/t/tips-for-debugging-go-in-an-ide/578>\
**Category:** Technical Discussion\
**Created:** [September 29, 2015, 9:21am UTC](https://forum.golangbridge.org/t/tips-for-debugging-go-in-an-ide/578 "2015-09-29T09:21:36Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jhngrant](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/jhngrant/32/621_2.png) [@jhngrant](https://forum.golangbridge.org/u/jhngrant)\
**Post date:** [September 29, 2015, 9:21am UTC](https://forum.golangbridge.org/t/tips-for-debugging-go-in-an-ide/578/1 "2015-09-29T09:21:36Z")

</div>

I’ve been using this method in Ubuntu 15.04 for about 4 weeks. It’s early days and by far an ideal solution. However, it has worked really well for me…

The latest build of the Go plugin for IntelliJ now incorporates the [Delve](https://github.com/derekparker/delve) package. If you don’t have a JetBrains IDE you can download the free Community Edition of IntelliJ.

[Install the Go plugin by first adding the pre-release repository](https://github.com/go-lang-plugin-org/go-lang-idea-plugin#pre-release-builds). Inside the editor you’ll see you can now create breakpoints in Go projects by clicking on the left gutter of the editor.

After setting a breakpoint create a run/debug configuration. The lazy way to create a configuration is to right click in the editor and choose Debug from the context menu. The default configuration will probably not work first time. To fix edit the run/debug configuration and ensure the Name field contains a simple name without spaces or periods. Also set the Output Directory local to the project. I also set the Working Directory so that relative paths to assets in web applications can work.

There is a bit more information about debugging a Go project in the [Go plugin wiki](https://github.com/go-lang-plugin-org/go-lang-idea-plugin/wiki/Documentation#debugging-a-go-project).

Do you have any tips for interactively debugger Go in Linux, Mac or Windows? Please share your experiences below.

---

<div class="post-metadata">

**Author:** ![kostya\_sh](https://forum.golangbridge.org/letter_avatar_proxy/v4/letter/k/5e9695/32.png) [@kostya\_sh](https://forum.golangbridge.org/u/kostya_sh)\
**Post date:** [September 29, 2015, 12:08pm UTC](https://forum.golangbridge.org/t/tips-for-debugging-go-in-an-ide/578/2 "2015-09-29T12:08:17Z")

</div>

I was able to debug Go programs (mainly tests) in Emacs using delve and [https://github.com/benma/go-dlv.el](https://github.com/benma/go-dlv.el). It is usable at least for small programs.

---

<div class="post-metadata">

**Author:** ![kpowick](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/kpowick/32/775_2.png) [@kpowick](https://forum.golangbridge.org/u/kpowick)\
**Post date:** [September 29, 2015, 3:37pm UTC](https://forum.golangbridge.org/t/tips-for-debugging-go-in-an-ide/578/3 "2015-09-29T15:37:40Z")

</div>

This doesn’t seem to be the correct category for such a post. Can it be re-categorized to the correct topic section of the forum?

---

<div class="post-metadata">

**Author:** ![jhngrant](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/jhngrant/32/621_2.png) [@jhngrant](https://forum.golangbridge.org/u/jhngrant)\
**Post date:** [September 29, 2015, 3:54pm UTC](https://forum.golangbridge.org/t/tips-for-debugging-go-in-an-ide/578/4 "2015-09-29T15:54:45Z")

</div>

What category would you suggest?

---

<div class="post-metadata">

**Author:** ![kpowick](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/kpowick/32/775_2.png) [@kpowick](https://forum.golangbridge.org/u/kpowick)\
**Post date:** [September 29, 2015, 4:13pm UTC](https://forum.golangbridge.org/t/tips-for-debugging-go-in-an-ide/578/5 "2015-09-29T16:13:51Z")

</div>

I would say that the _Technical Discussions_ category is a better fit for your post. The _Releases_ category is supposed to be for announcing new Go projects and packages.

---

<div class="post-metadata">

**Author:** ![jhngrant](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/jhngrant/32/621_2.png) [@jhngrant](https://forum.golangbridge.org/u/jhngrant)\
**Post date:** [September 29, 2015, 4:20pm UTC](https://forum.golangbridge.org/t/tips-for-debugging-go-in-an-ide/578/6 "2015-09-29T16:20:34Z")

</div>

I thought being about the Delve package the original choice was best. Your suggestion makes sense, so it’s been changed.

---

<div class="post-metadata">

**Author:** ![jmervine](https://forum.golangbridge.org/user_avatar/forum.golangbridge.org/jmervine/32/564_2.png) [@jmervine](https://forum.golangbridge.org/u/jmervine)\
**Post date:** [September 29, 2015, 5:12pm UTC](https://forum.golangbridge.org/t/tips-for-debugging-go-in-an-ide/578/7 "2015-09-29T17:12:15Z")

</div>

I have no interest in starting a holy war here, so I’ll say for those that use vim, here’s the plugin’s I use for a psudo-IDK like experience are:

- [https://github.com/nsf/gocode](https://github.com/nsf/gocode)
- [https://github.com/fatih/vim-go](https://github.com/fatih/vim-go)

---

<div class="post-metadata">

**Author:** ![system](https://forum.golangbridge.org/uploads/default/original/2X/5/5ad234f7c3dbc68b6cc72d338ce4f2973d9fd81c.png) [@system](https://forum.golangbridge.org/u/system)\
**Post date:** [December 28, 2015, 5:12pm UTC](https://forum.golangbridge.org/t/tips-for-debugging-go-in-an-ide/578/8 "2015-12-28T17:12:23Z")

</div>

Closed on December 28, 2015, 5:12pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
