You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While fixing an issue (#60223) with the existing windows.EnumProcesses we had to introduce some manually written code wrapping what mkwinsyscall can generate and realized that the function signature we have is quite weird: it has *uint32 in its second parameter to return the number of bytes taken by the data added to the processIds slice.
It would be much more ergonomic to have an API that looks like
where n has the number of items added to the input slice.
To keep backward compatibility, we would need to keep the old function and add a new one with a different name. So the final proposal is to add EnumProcs with the signature below and to mark EnumProcesses as deprecated.
Thanks for your proposal @roman-mazur . But I would not add new API.
I don't believe golang.prg/x/sys/windows.EnumProcesses function is important enough to warrant two versions (version that matches Microsoft interface with "depreciated" tag and "ergonomic" version).
And personally I like golang.prg/x/sys/windows APIs that match Microsoft documentation. When using APIs, I always rely on Microsoft documentation. Microsoft Win32 APIs documentation is always very good.
While fixing an issue (#60223) with the existing
windows.EnumProcesses
we had to introduce some manually written code wrapping whatmkwinsyscall
can generate and realized that the function signature we have is quite weird: it has*uint32
in its second parameter to return the number of bytes taken by the data added to theprocessIds
slice.It would be much more ergonomic to have an API that looks like
where
n
has the number of items added to the input slice.To keep backward compatibility, we would need to keep the old function and add a new one with a different name. So the final proposal is to add
EnumProcs
with the signature below and to markEnumProcesses
as deprecated.I do have a need for this function, but am I alone?
The text was updated successfully, but these errors were encountered: