bazel-contrib / bazel-contrib/rules_go
Proposal: Allow debugging `go_test` targets with Delve
- Dominant language
- Go
- Stars
- 1.5k
- Forks
- 762
- Avg merge
- 1d 11h
- Merged PRs (30d)
- 12
Description
I ran a Go test and wanted to debug it. I expected to find a `--go_debug` flag as an analog to the [--java_debug](https://bazel.build/reference/command-line-reference#flag--java_debug) flag:
```
bazel test my/app:test --go_debug
```
It would be great if this (or something like it) existed to run tests with Delve and wait for a debugger to be attached. It would provide a much less awkward mechanism for debugging Go code.
Contributor guide
Research direction
Start by tracing how the `go_test` target is implemented and how Bazel's `--java_debug` behavior is exposed. Determine where a Delve-backed test invocation and debugger wait would fit; done means a command such as `bazel test my/app:test --go_debug` can launch the test and wait for an attached debugger.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- build-system, devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100