10// IsStaleSocketErr reports whether err indicates that a Unix-domain
11// socket file exists on disk but no process is listening on it (a stale
12// or orphaned socket). It returns false for nil and for timeout errors.
14// The classification is cross-platform: ECONNREFUSED and fs.ErrNotExist
15// are defined on every supported OS, so callers on Windows can use the
16// same helper even though stale-socket recovery only applies to Unix
17// sockets in practice.
18func IsStaleSocketErr(err error) bool {
23 if errors.As(err, &netErr) && netErr.Timeout() {
26 return errors.Is(err, syscall.ECONNREFUSED) || errors.Is(err, fs.ErrNotExist)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list