Merge PR #4919: Fix GetConfirmation User Input Bug
This commit is contained in:
committed by
Alexander Bezobchuk
parent
70d50a6a61
commit
91b53f2698
@@ -74,7 +74,12 @@ func GetConfirmation(prompt string, buf *bufio.Reader) (bool, error) {
|
||||
return false, err
|
||||
}
|
||||
|
||||
response = strings.ToLower(strings.TrimSpace(response))
|
||||
response = strings.TrimSpace(response)
|
||||
if len(response) == 0 {
|
||||
return false, nil
|
||||
}
|
||||
|
||||
response = strings.ToLower(response)
|
||||
if response[0] == 'y' {
|
||||
return true, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user