Source file
src/net/error_unix_test.go
1
2
3
4
5
6
7 package net
8
9 import (
10 "errors"
11 "os"
12 "syscall"
13 )
14
15 var (
16 errOpNotSupported = syscall.EOPNOTSUPP
17
18 abortedConnRequestErrors = []error{syscall.ECONNABORTED}
19 )
20
21 func isPlatformError(err error) bool {
22 _, ok := err.(syscall.Errno)
23 return ok
24 }
25
26 func samePlatformError(err, want error) bool {
27 if op, ok := err.(*OpError); ok {
28 err = op.Err
29 }
30 if sys, ok := err.(*os.SyscallError); ok {
31 err = sys.Err
32 }
33 return err == want
34 }
35
36 func isENOBUFS(err error) bool {
37 return errors.Is(err, syscall.ENOBUFS)
38 }
39
View as plain text