From cb1a5f86f290f6128a392ff259320e022fcafbf6 Mon Sep 17 00:00:00 2001 From: James Kwon Date: Fri, 24 May 2024 18:36:14 -0400 Subject: [PATCH] issue panic without any command fix --- telemetry/telemetry.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/telemetry/telemetry.go b/telemetry/telemetry.go index 007812da..54bc83c0 100644 --- a/telemetry/telemetry.go +++ b/telemetry/telemetry.go @@ -1,8 +1,9 @@ package telemetry import ( - "github.com/gruntwork-io/go-commons/telemetry" "os" + + "github.com/gruntwork-io/go-commons/telemetry" ) var sendTelemetry = true @@ -16,9 +17,11 @@ func InitTelemetry(name string, version string) { isCircleCi = os.Getenv("CIRCLECI") == "true" sendTelemetry = !disableTelemetryFlag if sendTelemetry { - cmd = os.Args[1] telemetryClient = telemetry.NewMixPanelTelemetryClient("https://t.gruntwork.io/", name, version) } + if len(os.Args) > 1 { + cmd = os.Args[1] + } } func SetAccountId(accountId string) {