all: use strings.EqualFold for string comparison (#24890)

This commit is contained in:
Håvard Anda Estensen
2022-05-17 13:56:52 +02:00
committed by GitHub
parent e0a9752b96
commit e644d45c14
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -143,7 +143,7 @@ func (p *terminalPrompter) PromptPassword(prompt string) (passwd string, err err
// choice to be made, returning that choice.
func (p *terminalPrompter) PromptConfirm(prompt string) (bool, error) {
input, err := p.Prompt(prompt + " [y/n] ")
if len(input) > 0 && strings.ToUpper(input[:1]) == "Y" {
if len(input) > 0 && strings.EqualFold(input[:1], "y") {
return true, nil
}
return false, err