refactor(core): extract destroy confirmation response helper
This commit is contained in:
@@ -266,8 +266,12 @@ func (a *App) confirmDestroy(castle string) (bool, error) {
|
|||||||
return false, err
|
return false, err
|
||||||
}
|
}
|
||||||
|
|
||||||
response := strings.ToLower(strings.TrimSpace(line))
|
return isAffirmativeResponse(line), nil
|
||||||
return response == "y" || response == "yes", nil
|
}
|
||||||
|
|
||||||
|
func isAffirmativeResponse(input string) bool {
|
||||||
|
response := strings.ToLower(strings.TrimSpace(input))
|
||||||
|
return response == "y" || response == "yes"
|
||||||
}
|
}
|
||||||
|
|
||||||
func (a *App) Open(castle string) error {
|
func (a *App) Open(castle string) error {
|
||||||
|
|||||||
Reference in New Issue
Block a user