mirror of
https://github.com/turbot/steampipe.git
synced 2026-01-24 08:01:31 -05:00
20 lines
384 B
Go
20 lines
384 B
Go
package utils
|
|
|
|
import (
|
|
"fmt"
|
|
"log"
|
|
"strings"
|
|
)
|
|
|
|
// UserConfirmation displays the warning message and asks the user for input
|
|
// regarding whether to continue or not
|
|
func UserConfirmation(warning string) bool {
|
|
fmt.Println(warning)
|
|
var userConfirm string
|
|
_, err := fmt.Scanf("%s", &userConfirm)
|
|
if err != nil {
|
|
log.Fatal(err)
|
|
}
|
|
return strings.ToUpper(userConfirm) == "Y"
|
|
}
|