From f8e8cc43e698d1c8f0e691f990e09d26dd725c1e Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Thu, 3 Mar 2022 19:02:35 -0800 Subject: [PATCH] Server test show sys error Signed-off-by: Derek McGowan --- server_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/server_test.go b/server_test.go index f9df05a..791c835 100644 --- a/server_test.go +++ b/server_test.go @@ -22,6 +22,7 @@ import ( "errors" "fmt" "net" + "os" "runtime" "strings" "sync" @@ -375,6 +376,13 @@ func TestClientEOF(t *testing.T) { if ok { t.Logf("errno=%d", errno) } else { + var oerr *net.OpError + if errors.As(err, &oerr) { + serr, sok := oerr.Err.(*os.SyscallError) + if sok { + t.Logf("Op=%q, syscall=%s, Err=%v", oerr.Op, serr.Syscall, serr.Err) + } + } t.Logf("error %q doesn't match syscall.Errno", err) }