From 5adb096d9de1b1e55c9dcde621f0479b306d7255 Mon Sep 17 00:00:00 2001 From: max Date: Thu, 8 Jan 2026 20:26:23 -0800 Subject: [PATCH] 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 --- internal/doctor/global_state_check.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/internal/doctor/global_state_check.go b/internal/doctor/global_state_check.go index 3855ec9a..c31c63f0 100644 --- a/internal/doctor/global_state_check.go +++ b/internal/doctor/global_state_check.go @@ -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") }