Skip to content

Commit

Permalink
syscall: let EPLAN9 and EWINDOWS implement errors.ErrUnsupported
Browse files Browse the repository at this point in the history
As suggested by Bryan. This should fix the failing
TestIPConnSpecificMethods on plan9 after CL 476217 was submitted.

For #41198

Change-Id: I18e87b3aa7c9f7d48a1bd9c2819340acd1d2ca4e
Reviewed-on: https://go-review.googlesource.com/c/go/+/476578
Reviewed-by: Cherry Mui <[email protected]>
Run-TryBot: Tobias Klauser <[email protected]>
Reviewed-by: Bryan Mills <[email protected]>
Auto-Submit: Tobias Klauser <[email protected]>
TryBot-Result: Gopher Robot <[email protected]>
  • Loading branch information
tklauser authored and gopherbot committed Mar 15, 2023
1 parent 455168d commit 3128edf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/syscall/syscall_plan9.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
package syscall

import (
"errors"
"internal/oserror"
"runtime"
"unsafe"
Expand Down Expand Up @@ -43,6 +44,8 @@ func (e ErrorString) Is(target error) bool {
case oserror.ErrNotExist:
return checkErrMessageContent(e, "does not exist", "not found",
"has been removed", "no parent")
case errors.ErrUnsupported:
return checkErrMessageContent(e, "not supported")
}
return false
}
Expand Down
2 changes: 2 additions & 0 deletions src/syscall/syscall_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,8 @@ func (e Errno) Is(target error) bool {
return e == ERROR_FILE_NOT_FOUND ||
e == _ERROR_BAD_NETPATH ||
e == ERROR_PATH_NOT_FOUND
case errorspkg.ErrUnsupported:
return e == EWINDOWS
}
return false
}
Expand Down

0 comments on commit 3128edf

Please sign in to comment.