]> Cypherpunks.ru repositories - gostls13.git/commit
syscall: add DLLError.Unwrap function
authorJason A. Donenfeld <Jason@zx2c4.com>
Fri, 13 Nov 2020 14:48:05 +0000 (15:48 +0100)
committerJason A. Donenfeld <Jason@zx2c4.com>
Sat, 21 Nov 2020 07:37:02 +0000 (07:37 +0000)
commitf7342596daa892400e91a407cac5843bc43dcdd0
treed32ea1fe33aaf1fd8c32669538df0db9d3f522f5
parentf93ef07b1143abf3003555c4afcadc0e9842cbf8
syscall: add DLLError.Unwrap function

Because we're expecting for future functions to be unavailable, we
should add an Unwrap() function to the DLLError struct, so that people
can test for this situation easily via:

    if errors.Is(err, syscall.ERROR_PROC_NOT_FOUND) { ... }

DLLError already was wrapping the underlying Errno error, but never got
the Go 1.13 helper method.

Fixes golang/go#42584

Change-Id: I0f32a5146946b1b37a30897ba825a56faefc792c
Reviewed-on: https://go-review.googlesource.com/c/go/+/269761
Run-TryBot: Jason A. Donenfeld <Jason@zx2c4.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
Trust: Alex Brainman <alex.brainman@gmail.com>
Trust: Jason A. Donenfeld <Jason@zx2c4.com>
doc/go1.16.html
src/syscall/dll_windows.go