I am trying to debug a simple Go program in GoLand. I set a breakpoint and when I press the debug button the program runs to its end and exites with exit code 0. The breakpoint is not hit. The program consists of a simple for cycle. When running it without debugging, it works as expected.
These are GOPATH and GOROOT env variables:
GOPATH='/home/indiana/go' GOROOT='/usr/local/go'
Tried some solutions for mac (couldn't anything for Linux that seemed reasonable)
Does someone have any idea where the problem may be?
Thanks in advance, Indiana
Time: 2024-03
Yes, golang 1.21 and 1.22 the same, but go 1.20 is working on IDEA or Golang in debug mode.
You could downgrade golang version to 1.20 for code debug, or waitting Jetbrains to fix the bug.