我有一个简单的Web应用程序,其中包含cmd /和pkg /文件夹。按照惯例,我将软件包导入cmd文件夹中的* .go文件中。设置断点在cmd中的任何文件中都可以正常工作,但在软件包中不起作用。
错误消息是:
could not find statement at <path_to_file>:<line_number>,please use a line with a statement
我正在使用的项目结构类似于以下简化形式:
project_root:
- cmd/
main.go
- pkg/
app.go // I set a breakpoint to a function here L:156. it's being called at main.go
...
- api/
- config/
...
我的构建标记具有-gcflags "all=-N -l"
过去曾在这里讨论过类似的问题:IntelliJ 2017.1.2 GOLANG debug does not work on breakpoints in packages
编辑:
- 添加了项目结构
- 添加了带有断点的行的屏幕截图