mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
syscall: document relationship among Errno, errors.Is and os.Err*
- Add doc to syscall.Errno (and syscall.ErrorString for plan9). - Mention under `syscall` in release notes. Fixes #33436. Change-Id: I032ffebaa76ed67eb9d748e7645ca73f26144ea0 Reviewed-on: https://go-review.googlesource.com/c/go/+/191337 Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
f3e3b71a50
commit
65e624e7b9
6 changed files with 37 additions and 0 deletions
|
|
@ -77,6 +77,12 @@ func UTF16PtrFromString(s string) (*uint16, error) {
|
|||
}
|
||||
|
||||
// Errno is the Windows error number.
|
||||
//
|
||||
// Errno values can be tested against error values from the the os package
|
||||
// using errors.Is. For example:
|
||||
//
|
||||
// _, _, err := syscall.Syscall(...)
|
||||
// if errors.Is(err, os.ErrNotExist) ...
|
||||
type Errno uintptr
|
||||
|
||||
func langid(pri, sub uint16) uint32 { return uint32(sub)<<10 | uint32(pri) }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue