Skip to content
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

Proposal: trap init functions #86

Open
xhd2015 opened this issue Apr 23, 2024 · 2 comments
Open

Proposal: trap init functions #86

xhd2015 opened this issue Apr 23, 2024 · 2 comments
Labels
trace the trace package
Milestone

Comments

@xhd2015
Copy link
Owner

xhd2015 commented Apr 23, 2024

Currently init functions are skipped, that makes it impossible to inject mock and collect trace during the init stage.

However since init functions just run once and run serially, it has no performance impact at all. It might be useful.

@xhd2015
Copy link
Owner Author

xhd2015 commented May 17, 2024

At least allow to trace package initialization traces. This can be done by simply inserting an init function in each package, and emit a print statement.

And maybe xgo can provide a tool called xgo inspect check-init, when invoked will do a static analysis to recursively find all imports and render the import tree in a web UI.

@xhd2015
Copy link
Owner Author

xhd2015 commented May 17, 2024

@xhd2015 xhd2015 added the trace the trace package label May 23, 2024
@xhd2015 xhd2015 added this to the v1.1.0 milestone May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
trace the trace package
Projects
Status: No status
Development

No branches or pull requests

1 participant