Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.Sign up
GitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
x/sys/windows: break compat and use implicit mksyscall string conversion #34309
x/sys/windows doesn't have a mod version, so maybe there's some leeway for breaking stuff. Here's the mischief I have in mind:
All functions that take strings in x/sys/windows take a *uint16. It's then up to the caller to do the rather cumbersome:
When you have lots of strings, this is really a drag.
As it turns out,
Under the hood, the generated bindings do the right thing.
Now to be clear, I'm not proposing that we change mksyscall.go to generate the string conversion code. Why? Because this is already implemented!
What I am suggesting is that we change all of the definitions in x/sys/windows to take a simple
It's a lot of functions, but not all are so commonly used. Here's a list:
I agree with Ian - let sleeping dogs lie.
golang.org/x/sys/windows package started its life as copy of windows version of syscall package. And windows version of syscall package was only intended to be used by other packages in standard library. It was not intended to be used directly by any programs. If you want 'nice' interface, we should not put into golang.org/x/sys/windows package. See golang.org/x/sys/windows/registry or golang.org/x/sys/windows/svc for an example of a nice package.