mirror of
https://github.com/safing/portmaster
synced 2025-04-25 13:29:10 +00:00
20 lines
271 B
Go
20 lines
271 B
Go
package main
|
|
|
|
import (
|
|
"bufio"
|
|
"fmt"
|
|
"os"
|
|
"strings"
|
|
)
|
|
|
|
func confirm(msg string) bool {
|
|
fmt.Printf("%s: [y|n] ", msg)
|
|
|
|
scanner := bufio.NewScanner(os.Stdin)
|
|
ok := scanner.Scan()
|
|
if ok && strings.TrimSpace(scanner.Text()) == "y" {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|