refactor(doctor): use strings.Contains instead of custom contains()

Replace the hand-rolled contains() function with the standard library
strings.Contains(). Also removes the redundant len(data) > 0 check
since strings.Contains handles empty strings correctly.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
max
2026-01-08 20:26:23 -08:00
committed by Steve Yegge
parent 81bfe48ed3
commit 5adb096d9d

View File

@@ -6,6 +6,7 @@ package doctor
import (
"os"
"path/filepath"
"strings"
"github.com/steveyegge/gastown/internal/shell"
"github.com/steveyegge/gastown/internal/state"
@@ -105,14 +106,5 @@ func hasShellIntegration(rcPath string) bool {
if err != nil {
return false
}
return len(data) > 0 && contains(string(data), "Gas Town Integration")
}
func contains(s, substr string) bool {
for i := 0; i <= len(s)-len(substr); i++ {
if s[i:i+len(substr)] == substr {
return true
}
}
return false
return strings.Contains(string(data), "Gas Town Integration")
}