Source file src/net/error_windows_test.go

     1  // Copyright 2015 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  package net
     6  
     7  import (
     8  	"errors"
     9  	"syscall"
    10  )
    11  
    12  var (
    13  	errOpNotSupported = syscall.EOPNOTSUPP
    14  
    15  	abortedConnRequestErrors = []error{syscall.ERROR_NETNAME_DELETED, syscall.WSAECONNRESET} // see accept in fd_windows.go
    16  )
    17  
    18  func isPlatformError(err error) bool {
    19  	_, ok := err.(syscall.Errno)
    20  	return ok
    21  }
    22  
    23  func isENOBUFS(err error) bool {
    24  	// syscall.ENOBUFS is a completely made-up value on Windows: we don't expect
    25  	// a real system call to ever actually return it. However, since it is already
    26  	// defined in the syscall package we may as well check for it.
    27  	return errors.Is(err, syscall.ENOBUFS)
    28  }
    29  

View as plain text