oboeru

a collection of simple, scriptable flashcard programs
git clone anongit@rnpnr.xyz:oboeru.git
Log | Files | Refs | Feed | README | LICENSE

Commit: 5de8d3b32b87889334dd37dbfab4efb404f2087a
Parent: 4eae999de673b348d5c94323a48d15924e4e0804
Author: Randy Palamar
Date:   Sun, 22 Aug 2021 14:47:07 -0600

oboerudata: error and exit if cardid doesn't exist in data

Diffstat:
Moboerudata.go | 6+++++-
1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/oboerudata.go b/oboerudata.go @@ -59,7 +59,11 @@ func wait_and_print(fifo string) { os.Exit(1) } - str, _ := m[deck][key] + str, ok := m[deck][key] + if !ok { + fmt.Fprintln(os.Stderr, "Data for card doesn't exist:", key) + os.Exit(1) + } fmt.Fprintln(os.Stdout, str) f.Close()