Generate windows syscalls using `go generate`
justenwalker opened this issue · 0 comments
justenwalker commented
Use go generate
tool to generate windows syscalls instead of writing them out manually.
This will help with maintainability
//go:generate go run golang.org/x/sys/windows/mkwinsyscall -output zsyscall_windows.go syscall_windows.go
Suggestion from #18 (comment) by @zx2c4 with details and examples
By the way, there's an easier way of dealing with all this using
//sys
. Check it out:In this file (or in any file, really), I define a bunch of calls like this one:
And then in this file, I have a go generate directive:
Which winds up creating a file containing the fuction, like: