xgo run -prof panics because profiling is not implemented
Author: znnnnnnn-wilCreated Sep 21, 2026Updated Sep 21, 2026
Labelsenhancement
Environment
- XGo: current
main(ad73bea11e630f64972b2d822486e66739fc51b4) - Go:
go1.26.5 windows/amd64
Description
The xgo run command advertises a -prof option, but using it always causes an intentional panic instead of producing a profiling report.
The option is included in the usage line and registered with the description do profile and generate profile report:
- https://github.com/goplus/xgo/blob/ad73bea11e630f64972b2d822486e66739fc51b4/cmd/internal/run/run.go#L36
- https://github.com/goplus/xgo/blob/ad73bea11e630f64972b2d822486e66739fc51b4/cmd/internal/run/run.go#L46
However, the implementation currently contains:
if *flagProf {
panic("TODO: profile not impl")
}Steps to reproduce
From a checkout of the repository:
go run ./cmd/xgo run -prof ./demo/sliceliteralActual behavior
The command exits with a panic and stack trace beginning with:
panic: TODO: profile not implExpected behavior
A documented command-line option should either work as described or not be exposed as a supported option. In either case, invoking xgo run should not hit an intentional TODO panic.
Suggested direction
Could the maintainers confirm the preferred direction?
- Remove the unsupported
-profoption from the usage text and flag definitions; or - Implement profiling for the current Go-backed execution path.
I can submit a PR after the intended compatibility behavior is confirmed.
Source: goplus/xgo