diff options
author | Anthony Wang | 2022-03-28 11:44:03 -0500 |
---|---|---|
committer | Anthony Wang | 2022-03-28 11:44:03 -0500 |
commit | 8d3e071c9e076a038b286520837c5db4212c8e84 (patch) | |
tree | b7a0f347a4b11e6d7ed299c885fbc9ec16cf3ee6 | |
parent | bd0ff43d83053edbd0809f8bd9ca3cc2abc687d9 (diff) |
Ask for user confirmation before showing val
-rw-r--r-- | sd.go | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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 |