From 811cd279bedaec393d15a53012b7908641e4a660 Mon Sep 17 00:00:00 2001 From: Sanyam Khurana Date: Thu, 29 Aug 2024 06:06:17 +0530 Subject: [PATCH] minor fix --- cmd/root.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/cmd/root.go b/cmd/root.go index 0d58699..480aa29 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -97,15 +97,11 @@ func checkForUpdate(ctx context.Context, currentVersion string) (*version.Releas return version.CheckForUpdate(ctx, http.DefaultClient, stateFilePath, repo, currentVersion) } -func exitWithCode(code int) { - os.Exit(code) -} - // Execute adds all child commands to the root command and sets flags appropriately. // This is called by main.main(). It only needs to happen once to the rootCmd. func Execute() { retcode := 0 - defer exitWithCode(retcode) + defer func() { os.Exit(retcode) }() // start update check process in the background ctx := context.Background()