Debugger for go?

Hello All,
I am wondering if anyone used any debugger for golang… I was trying
but to my regret I am not sure it works…
I ran:
go get
I was trying to build it without much luck… :frowning:
go build cmd.go


./cmd.go:215: undefined: doGopathWorkaround
./cmd.go:250: undefined: doGopathWorkaround
I am running it on:
mac os Sierra v10.12
go version
go version go1.7 darwin/amd64

any hint/suggestion from anyone, please?

thank you in advance.

Try Delve:

1 Like

thank you Cristophberger.
I wish I could…
==> ./make.bash --no-clean
Last 15 lines from /Users/slavamas/Library/Logs/Homebrew/go/01.make.bash:
/private/tmp/go-20161016-11720-1a93umd/go/gobootstrap/src/cmd/go/pkg.go:919 +0x74 fp=0xc2080e7c50 sp=0xc2080e7b40
main.runInstall(0x3f9a40, 0xc20800a090, 0x1, 0x1)
/private/tmp/go-20161016-11720-1a93umd/go/gobootstrap/src/cmd/go/build.go:330 +0x55 fp=0xc2080e7d98 sp=0xc2080e7c50
/private/tmp/go-20161016-11720-1a93umd/go/gobootstrap/src/cmd/go/main.go:163 +0x608 fp=0xc2080e7f98 sp=0xc2080e7d98
/usr/local/go/src/runtime/proc.go:63 +0xf3 fp=0xc2080e7fe0 sp=0xc2080e7f98
/usr/local/go/src/runtime/asm_amd64.s:2232 +0x1 fp=0xc2080e7fe8 sp=0xc2080e7fe0

goroutine 5 [syscall]:
/usr/local/go/src/os/signal/signal_unix.go:21 +0x1f
created by os/signal.init·1
/usr/local/go/src/os/signal/signal_unix.go:27 +0x35

Warning: You are using OS X 10.12.
We do not provide support for this pre-release version.
You may encounter build failures or other breakages.

…10.12 is not actually a pre-release version…

I’ve been using the Go plugin for the IntelliJ platform for over 12 months without any grief. In fact I couldn’t go without it.

The plugin integrates Delve to provide interactive debugging. It works seamlessly, even on Windows.

There is a free community edition of IntelliJ IDEA available from the JetBrains website.

The go plugin for vs code also uses delve. Worth a look and a little lighter than intellij.

Looks like there is a known bug (although the symptoms look a bit different):

Thank you, John! - I totally forgot about InteliJ, which is installed and running on my laptop - just because I mostly do everything on the command line (coding in vim and just running files on the command line). thank you for reminding.

1 Like

Christopher, ah… you’re right… just when I read your reply, I started inspecting brew’s messages… and understood why it did not work for me. brew was trying to install go V. 1.4 on my laptop. and because I have already installed and running go v.1.7… it obviously was failed… wondering now… why brew is trying to install such an old version…? :wink:

That’s strange indeed. You could try running brew update once or twice, then brew info go, and if the info still says 1.4, then run brew doctor to see if there is anything wrong with Homebrew’s software list.

As others have mentioned, I would definitely recommend both IntelliJ and VS Code. I dislike both for “religious” reasons - the former being Java and the latter Microsoft, but hey, they both work and work well. VS Code is much lighter FWIW.

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