Black Lives Matter. Support the Equal Justice Initiative.

Source file src/net/error_unix.go

Documentation: net

     1  // Copyright 2018 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  //go:build aix || darwin || dragonfly || freebsd || js || linux || netbsd || openbsd || solaris
     6  // +build aix darwin dragonfly freebsd js linux netbsd openbsd solaris
     7  
     8  package net
     9  
    10  import "syscall"
    11  
    12  func isConnError(err error) bool {
    13  	if se, ok := err.(syscall.Errno); ok {
    14  		return se == syscall.ECONNRESET || se == syscall.ECONNABORTED
    15  	}
    16  	return false
    17  }
    18  

View as plain text