Skip to content

Commit 36a7cfb

Browse files
committed
defult value is yes
1 parent d398568 commit 36a7cfb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: internal/print/print.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,11 @@ func Question(ask string) bool {
6161
cmdinfo.Name, color.GreenString("CHECK"), ask+" [Y/n] ")
6262
_, err := FmtScanln(&response)
6363
if err != nil {
64-
// If user input only enter.
64+
// If user input only enter, [Y/n] syntax is commonly used to denote that
65+
// "yes" is the default.
66+
// https://github.com/nao1215/gup/issues/146
6567
if strings.Contains(err.Error(), "expected newline") {
66-
return Question(ask)
68+
return true
6769
}
6870
fmt.Fprint(os.Stderr, err.Error())
6971
return false

0 commit comments

Comments
 (0)