From 8d3e071c9e076a038b286520837c5db4212c8e84 Mon Sep 17 00:00:00 2001 From: Anthony Wang Date: Mon, 28 Mar 2022 11:44:03 -0500 Subject: Ask for user confirmation before showing val --- sd.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sd.go b/sd.go index ac1d46d..d1a6756 100644 --- a/sd.go +++ b/sd.go @@ -97,10 +97,13 @@ func main() { var key, val string db.QueryRow("SELECT key, val FROM cards WHERE idx=?", i).Scan(&key, &val) fmt.Println(key) + + // Wait for confirmation + var b []byte = make([]byte, 1) + os.Stdin.Read(b) fmt.Println(val) // Read user input - var b []byte = make([]byte, 1) os.Stdin.Read(b) if b[0] == byte('y') { w >>= 1 -- cgit v1.2.3-70-g09d2