safesocket: add ConnectContext
This adds a variant for Connect that takes in a context.Context which allows passing through cancellation etc by the caller. Updates tailscale/corp#18266 Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
package safesocket
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
@@ -57,7 +58,7 @@ func TestBasics(t *testing.T) {
|
||||
}()
|
||||
|
||||
go func() {
|
||||
c, err := Connect(sock)
|
||||
c, err := ConnectContext(context.Background(), sock)
|
||||
if err != nil {
|
||||
errs <- err
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user