Skip to content

Commit

Permalink
Let erroneous input fall through to the default switch case
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVulaj committed Jun 23, 2023
1 parent 28cc273 commit c4911a1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,11 +228,7 @@ func ConfirmPrompt() bool {
fmt.Print("Continue? (y/N): ")

var response string
_, err := fmt.Scanln(&response)
if err != nil {
fmt.Println("Invalid input. Expecting (yes) or (N)o")
return ConfirmPrompt()
}
_, _ = fmt.Scanln(&response) // Erroneous input will be handled by the default case below

switch strings.ToLower(response) {
case "y", "yes":
Expand Down

0 comments on commit c4911a1

Please sign in to comment.