Skip to content

proposal: x/sys/windows: export getProcessEntry #57474

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
thaJeztah opened this issue Dec 27, 2022 · 2 comments
Open

proposal: x/sys/windows: export getProcessEntry #57474

thaJeztah opened this issue Dec 27, 2022 · 2 comments

Comments

@thaJeztah
Copy link
Contributor

The getProcessEntry code is currently duplicated in https://github.com/inconshreveable/mousetrap, which is widely used in projects (commonly as dependency for spf13/cobra). Until recently, mousetrap had code for backward-compatibility with old Go versions, but now that that code was removed, it's a very small wrapper around getProcessEntry. Exporting this function allows mousetrap to not having to duplicate the code, or for projects currently depending on mousetrap to consume the golang.org/x/sys code directly (most projects would already have golang.org/x/sys as dependency in some form or another).

Looking at the history for getProcessEntry, I see that this function was originally contributed by the author of Mousetrap (as a helper for Getppid(); see 6f6f1bd / https://codereview.appspot.com/102320044), and there have been no changes since its inception. From that perspective, I estimate it won't add additional maintenance costs to the x/sys project.

@gopherbot gopherbot added this to the Proposal milestone Dec 27, 2022
@ianlancetaylor ianlancetaylor moved this to Incoming in Proposals Dec 27, 2022
@ianlancetaylor
Copy link
Member

CC @golang/windows

@ianlancetaylor
Copy link
Member

The current getProcessEntry function is undocumented. Can you write an example doc comment for GetProcessEntry? Thanks.

@seankhliao seankhliao changed the title proposal: golang.org/x/sys/windows: export getProcessEntry proposal: x/sys/windows: export getProcessEntry Apr 6, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
Status: Incoming
Development

No branches or pull requests

3 participants