@@ -54,14 +54,14 @@ func TestInitCommand(t *testing.T) {
5454 }
5555
5656 // Run the init command
57- app := & cli.Command {}
58- app .Commands = []* cli.Command {
57+ cliApp := & cli.Command {}
58+ cliApp .Commands = []* cli.Command {
5959 SetupInitCommand (cliCtx ),
6060 }
6161
6262 output , err := testhelpers .CaptureStdout (func () {
6363 args := []string {"tempo" , "init" , "--base-folder" , baseFolder }
64- err := app .Run (context .Background (), args )
64+ err := cliApp .Run (context .Background (), args )
6565 if err != nil {
6666 t .Fatalf ("Unexpected error: %v" , err )
6767 }
@@ -106,13 +106,13 @@ func TestInitCommand_FailsOnExistingConfigFile(t *testing.T) {
106106 t .Fatalf ("Failed to create config file: %v" , err )
107107 }
108108
109- app := & cli.Command {}
110- app .Commands = []* cli.Command {
109+ cliApp := & cli.Command {}
110+ cliApp .Commands = []* cli.Command {
111111 SetupInitCommand (cliCtx ),
112112 }
113113
114114 args := []string {"tempo" , "init" , "--base-folder" , tempDir }
115- err = app .Run (context .Background (), args )
115+ err = cliApp .Run (context .Background (), args )
116116
117117 if err == nil {
118118 t .Fatal ("Expected error, but got none" )
@@ -138,8 +138,8 @@ func TestInitCommand_FailsOnUnwritableConfigFile(t *testing.T) {
138138 CWD : tempDir ,
139139 }
140140
141- app := & cli.Command {}
142- app .Commands = []* cli.Command {
141+ cliApp := & cli.Command {}
142+ cliApp .Commands = []* cli.Command {
143143 SetupInitCommand (cliCtx ),
144144 }
145145
@@ -172,7 +172,7 @@ func TestInitCommand_FailsOnUnwritableConfigFile(t *testing.T) {
172172
173173 // Step 3: Run `init` again, expecting a write error
174174 args := []string {"tempo" , "init" , "--base-folder" , tempDir }
175- err = app .Run (context .Background (), args )
175+ err = cliApp .Run (context .Background (), args )
176176
177177 if err == nil {
178178 t .Fatal ("Expected error due to unwritable file, but got none" )
@@ -224,13 +224,13 @@ func TestInitCommand_UsesDefaultTemplateExtensions(t *testing.T) {
224224 // Override config to simulate missing extensions
225225 cliCtx .Config .Templates .Extensions = []string {} // Force empty slice
226226
227- app := & cli.Command {}
228- app .Commands = []* cli.Command {
227+ cliApp := & cli.Command {}
228+ cliApp .Commands = []* cli.Command {
229229 SetupInitCommand (cliCtx ),
230230 }
231231
232232 args := []string {"tempo" , "init" , "--base-folder" , tempDir }
233- err := app .Run (context .Background (), args )
233+ err := cliApp .Run (context .Background (), args )
234234
235235 if err != nil {
236236 t .Fatalf ("Unexpected error: %v" , err )
@@ -380,8 +380,8 @@ func TestInitCommand_FailsOnConfigFileCheckError(t *testing.T) {
380380 CWD : tempDir ,
381381 }
382382
383- app := & cli.Command {}
384- app .Commands = []* cli.Command {
383+ cliApp := & cli.Command {}
384+ cliApp .Commands = []* cli.Command {
385385 SetupInitCommand (cliCtx ),
386386 }
387387
@@ -393,7 +393,7 @@ func TestInitCommand_FailsOnConfigFileCheckError(t *testing.T) {
393393
394394 // Step 2: Run `init`, expecting an error
395395 args := []string {"tempo" , "init" , "--base-folder" , tempDir }
396- err := app .Run (context .Background (), args )
396+ err := cliApp .Run (context .Background (), args )
397397 if err == nil {
398398 t .Fatal ("Expected error due to file existence check failure, but got none" )
399399 }
@@ -413,8 +413,8 @@ func TestInitCommand_FailsOnMissingGoMod(t *testing.T) {
413413 CWD : tempDir ,
414414 }
415415
416- app := & cli.Command {}
417- app .Commands = []* cli.Command {
416+ cliApp := & cli.Command {}
417+ cliApp .Commands = []* cli.Command {
418418 SetupInitCommand (cliCtx ),
419419 }
420420
@@ -428,7 +428,7 @@ func TestInitCommand_FailsOnMissingGoMod(t *testing.T) {
428428
429429 // Run `init`, expecting an error due to missing go.mod
430430 args := []string {"tempo" , "init" , "--base-folder" , tempDir }
431- err := app .Run (context .Background (), args )
431+ err := cliApp .Run (context .Background (), args )
432432
433433 if err == nil {
434434 t .Fatal ("Expected error due to missing go.mod file, but got none" )
0 commit comments