console/prompt: use PromptInput in PromptConfirm method #33445 (#1953)

Co-authored-by: oooLowNeoNooo <ooolowneonooo@gmail.com>
This commit is contained in:
Daniel Liu 2026-01-19 14:45:27 +08:00 committed by GitHub
parent b4cbf663a7
commit bef85ec37b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -142,7 +142,7 @@ func (p *terminalPrompter) PromptPassword(prompt string) (passwd string, err err
// PromptConfirm displays the given prompt to the user and requests a boolean
// choice to be made, returning that choice.
func (p *terminalPrompter) PromptConfirm(prompt string) (bool, error) {
input, err := p.Prompt(prompt + " [y/N] ")
input, err := p.PromptInput(prompt + " [y/n] ")
if len(input) > 0 && strings.EqualFold(input[:1], "y") {
return true, nil
}