From 2ce5fc7b0a16eaa85d1d1e8d8c807c3330984a3b Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Wed, 27 Oct 2021 14:53:28 -0700 Subject: [PATCH] safesocket: fail early on js/wasm Updates #3157 Change-Id: Ib78efb3b1ba34ca4fb34296033b95327188774a7 Signed-off-by: Brad Fitzpatrick --- safesocket/unixsocket.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/safesocket/unixsocket.go b/safesocket/unixsocket.go index bbf822f03..a49e227eb 100644 --- a/safesocket/unixsocket.go +++ b/safesocket/unixsocket.go @@ -8,6 +8,7 @@ package safesocket import ( + "errors" "fmt" "io" "io/ioutil" @@ -23,6 +24,9 @@ // TODO(apenwarr): handle magic cookie auth func connect(path string, port uint16) (net.Conn, error) { + if runtime.GOOS == "js" { + return nil, errors.New("safesocket.Connect not yet implemented on js/wasm") + } if runtime.GOOS == "darwin" && path == "" && port == 0 { return connectMacOSAppSandbox() }