From 3128edfe59d3f0d677ae9ad24bf2c7474056787a Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 15 Mar 2023 19:26:33 +0100 Subject: [PATCH] syscall: let EPLAN9 and EWINDOWS implement errors.ErrUnsupported 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 Run-TryBot: Tobias Klauser Reviewed-by: Bryan Mills Auto-Submit: Tobias Klauser TryBot-Result: Gopher Robot --- src/syscall/syscall_plan9.go | 3 +++ src/syscall/syscall_windows.go | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/syscall/syscall_plan9.go b/src/syscall/syscall_plan9.go index 92414709ef4609..759f8051e860f3 100644 --- a/src/syscall/syscall_plan9.go +++ b/src/syscall/syscall_plan9.go @@ -12,6 +12,7 @@ package syscall import ( + "errors" "internal/oserror" "runtime" "unsafe" @@ -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 } diff --git a/src/syscall/syscall_windows.go b/src/syscall/syscall_windows.go index 1d8b6568c078ff..ae9b49a28d4ac7 100644 --- a/src/syscall/syscall_windows.go +++ b/src/syscall/syscall_windows.go @@ -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 }