feat: read bool 更新
This commit is contained in:
+3
-1
@@ -9,6 +9,7 @@ import (
|
||||
)
|
||||
|
||||
func ReadBool() bool {
|
||||
retry:
|
||||
read := bufio.NewReader(os.Stdin)
|
||||
ret, _ := read.ReadByte()
|
||||
switch ret {
|
||||
@@ -20,8 +21,9 @@ func ReadBool() bool {
|
||||
fallthrough
|
||||
case 'N':
|
||||
return false
|
||||
default:
|
||||
goto retry
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func ReadBoolWithMessage(message string) bool {
|
||||
|
||||
Reference in New Issue
Block a user