Where can I find the documentation for SyscallN, since syscall.Syscall6 has been deprecated as of Go 1.18?

757 Views Asked by At

When I run golangci-lint on my Go code after changing the go value in my go.mod from go 1.16 to go 1.20, I now get this linter warning:

windows.go:210:16: SA1019: syscall.Syscall6 has been deprecated since Go 1.18: Use SyscallN instead. (staticcheck)
        err, _, _ := syscall.Syscall6(fn, 5, addr, uintptr(unsafe.Pointer(&size)), 1, uintptr(family), uintptr(class), 0)

I wanted to compare the documentation for SyscallN to syscall.Syscall6 to see if there were any gotchas for moving from the deprecated function to the recommended replacement, but I cannot retrieve documentation for the function with go doc or find documentation for the function in the syscall package docs. The syscall package docs have a Syscall6 entry, but no SycallN entry. When I try to use go doc, I get this:

$ go doc syscall.SyscallN
doc: no symbol SyscallN in package syscall
exit status 1

Is SyscallN in a package other than syscall? Where can I find the documentation for SyscallN?

Note that this is for Windows-specific code guarded by a //go:build windows comment at the top of the windows.go file.

1

There are 1 best solutions below

0
On BEST ANSWER

As pointed out by @SteffenUllrich, I had to change the Rendered for dropdown value from linux/amd64 like this:

enter image description here

to windows/amd64 like this:

enter image description here

The documentation for syscall.SyscallN is available here (note the query component in the URL): https://pkg.go.dev/syscall?GOOS=windows#SyscallN