Skip to content

Commit e736dae

Browse files
committed
fix: resolve lint issues in startShell (perfsprint, gocritic)
Assisted-By: docker-agent
1 parent 7fbbd0c commit e736dae

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkg/tui/handlers.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -595,25 +595,25 @@ func (m *appModel) handleElicitationResponse(action tools.ElicitationAction, con
595595
}
596596

597597
func (m *appModel) startShell() (tea.Model, tea.Cmd) {
598-
exitMsg := fmt.Sprintf("Type 'exit' to return to %s", m.appName)
598+
exitMsg := "Type 'exit' to return to " + m.appName
599599

600600
var cmd *exec.Cmd
601601
if goruntime.GOOS == "windows" {
602602
if path, err := exec.LookPath("pwsh.exe"); err == nil {
603603
cmd = exec.Command(path, "-NoLogo", "-NoExit", "-Command",
604-
fmt.Sprintf(`Write-Host ""; Write-Host "%s"`, exitMsg))
604+
`Write-Host ""; Write-Host "`+exitMsg+`"`)
605605
} else if path, err := exec.LookPath("powershell.exe"); err == nil {
606606
cmd = exec.Command(path, "-NoLogo", "-NoExit", "-Command",
607-
fmt.Sprintf(`Write-Host ""; Write-Host "%s"`, exitMsg))
607+
`Write-Host ""; Write-Host "`+exitMsg+`"`)
608608
} else {
609609
// Use absolute path to cmd.exe to prevent PATH hijacking (CWE-426).
610610
shell := shellpath.WindowsCmdExe()
611-
cmd = exec.Command(shell, "/K", fmt.Sprintf(`echo. & echo %s`, exitMsg))
611+
cmd = exec.Command(shell, "/K", "echo. & echo "+exitMsg)
612612
}
613613
} else {
614614
shell := shellpath.DetectUnixShell()
615615
cmd = exec.Command(shell, "-i", "-c",
616-
fmt.Sprintf(`echo -e "\n%s"; exec %s`, exitMsg, shell))
616+
`echo -e "\n`+exitMsg+`"; exec `+shell)
617617
}
618618
cmd.Stdin = os.Stdin
619619
cmd.Stdout = os.Stdout

0 commit comments

Comments
 (0)