From 6b1d2a5630bfea79e5bc0f110204af4d74a1ac19 Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Tue, 20 Oct 2020 10:40:12 -0700 Subject: [PATCH] ipn: don't set DebugFlags to len 1 slice of empty string [""] Signed-off-by: Brad Fitzpatrick --- ipn/local.go | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/ipn/local.go b/ipn/local.go index 7487fd4fa..1bf30d996 100644 --- a/ipn/local.go +++ b/ipn/local.go @@ -36,9 +36,14 @@ import ( "tailscale.com/wgengine/tsdns" ) -var ( - controlDebugFlags = strings.Split(os.Getenv("TS_DEBUG_CONTROL_FLAGS"), ",") -) +var controlDebugFlags = getControlDebugFlags() + +func getControlDebugFlags() []string { + if e := os.Getenv("TS_DEBUG_CONTROL_FLAGS"); e != "" { + return strings.Split(e, ",") + } + return nil +} // LocalBackend is the glue between the major pieces of the Tailscale // network software: the cloud control plane (via controlclient), the