From 8f51cf368a1dc62e9dfc20cdc2c2a86b14ca8e6a Mon Sep 17 00:00:00 2001 From: Micheal Wilkinson Date: Sat, 21 Mar 2026 10:58:34 +0000 Subject: [PATCH] refactor(core): extract destroy confirmation response helper --- internal/homesick/core/core.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/internal/homesick/core/core.go b/internal/homesick/core/core.go index 04ddca4..f3c3f36 100644 --- a/internal/homesick/core/core.go +++ b/internal/homesick/core/core.go @@ -266,8 +266,12 @@ func (a *App) confirmDestroy(castle string) (bool, error) { return false, err } - response := strings.ToLower(strings.TrimSpace(line)) - return response == "y" || response == "yes", nil + return isAffirmativeResponse(line), nil +} + +func isAffirmativeResponse(input string) bool { + response := strings.ToLower(strings.TrimSpace(input)) + return response == "y" || response == "yes" } func (a *App) Open(castle string) error {