From 7a0de2997ec24c2dc9a860ae230e3af4ebbe290e Mon Sep 17 00:00:00 2001 From: Sonia Appasamy Date: Wed, 11 Oct 2023 14:36:47 -0400 Subject: [PATCH] client/web: remove unused context param from NewServer Updates tailscale/corp#14335 Signed-off-by: Sonia Appasamy --- client/web/web.go | 3 +-- cmd/tailscale/cli/web.go | 2 +- tsnet/example/web-client/web-client.go | 4 +--- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/client/web/web.go b/client/web/web.go index c76cd4955..b680ea7f4 100644 --- a/client/web/web.go +++ b/client/web/web.go @@ -125,8 +125,7 @@ type ServerOpts struct { } // NewServer constructs a new Tailscale web client server. -// The provided context should live for the duration of the Server's lifetime. -func NewServer(ctx context.Context, opts ServerOpts) (s *Server, cleanup func()) { +func NewServer(opts ServerOpts) (s *Server, cleanup func()) { if opts.LocalClient == nil { opts.LocalClient = &tailscale.LocalClient{} } diff --git a/cmd/tailscale/cli/web.go b/cmd/tailscale/cli/web.go index 2a3c416e8..7e5cfddf5 100644 --- a/cmd/tailscale/cli/web.go +++ b/cmd/tailscale/cli/web.go @@ -80,7 +80,7 @@ func runWeb(ctx context.Context, args []string) error { return fmt.Errorf("too many non-flag arguments: %q", args) } - webServer, cleanup := web.NewServer(ctx, web.ServerOpts{ + webServer, cleanup := web.NewServer(web.ServerOpts{ DevMode: webArgs.dev, CGIMode: webArgs.cgi, PathPrefix: webArgs.prefix, diff --git a/tsnet/example/web-client/web-client.go b/tsnet/example/web-client/web-client.go index 52a0adff0..903088f23 100644 --- a/tsnet/example/web-client/web-client.go +++ b/tsnet/example/web-client/web-client.go @@ -5,7 +5,6 @@ package main import ( - "context" "flag" "log" "net/http" @@ -21,7 +20,6 @@ func main() { flag.Parse() - ctx := context.Background() s := new(tsnet.Server) defer s.Close() @@ -32,7 +30,7 @@ func main() { } // Serve the Tailscale web client. - ws, cleanup := web.NewServer(ctx, web.ServerOpts{ + ws, cleanup := web.NewServer(web.ServerOpts{ DevMode: *devMode, LocalClient: lc, })