Closed willfaught closed 2 years ago
This is doable. It's not something I have wanted myself, though -- can you give an example where this would be helpful, so I can better understand the use case?
One thing I have considered doing is automatically inserting a breakpoint at program/test start when there are no other breakpoints. Would that provide what you want? Or are there times when you have inserted explicit _ = "breakpoint"
lines in your source and you also want to beak at program/test start?
Automatically inserting a breakpoint at program/test start when there are no other breakpoints would be perfect.
Not to necro this... but for use in environments with strict code quality control, having devs forget to remove _ = "breakpoint"
lines when committing becomes an annoying overhead problem. So related to this particular feature request, would also be nice to have the ability to pass in breakpoints via the command line by specifying the file+line number. Something like: godebug run -break=file1.go:34,file2.go:183 ...
I've had that problem too. I like that idea. The ability to name funcs/methods to break at the start of would be useful too.
I suppose this can always be done manually by putting
_ = "breakpoint"
as the first line in yourmain
orTest*
funcs, but it would be really handy to be able to go to any main package and just dogodebug run
orgodebug test
and be debugging immediately.Perhaps an optional
-debug.break
flag or something could enable this:godebug run -debug.break
andgodebug test -debug.break