-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
debug project with custom structure #63
Comments
Current Solution Desired Enhancement |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@amirphl please check if |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
I have a project with such a structure:
project/
|-- cmd/
| |-- main.go
|-- service/
| |-- company/
| |-- service.go
|-- repo/
I normally run the project using this command:
go run ./cmd serve
Here.
serve
is just an argument.Problematic Scenarios
When placing a breakpoint in a function in
service.go
, the debugging process fails because the build command is incorrect:go build -o <path-to-executable> -gcflags all=-N -l <path-to>/service/company/service.go
This command is invalid as it attempts to compile a file that does not contain the main function.
Conversely, when navigating to
main.go
and attempting to debug, the generated build command is also incorrect:go build -o <path-to-executable> -gcflags all=-N -l <path-to>/cmd/main.go
It should instead execute:
go build -o <path-to-executable> -gcflags all=-N -l <path-to>/cmd serve
I appreciate any help to fix the problem.
The text was updated successfully, but these errors were encountered: