aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjoop <Joop Kiefte>2022-04-02 05:27:07 +0100
committerjoop <Joop Kiefte>2022-04-02 05:27:07 +0100
commit5d5df5a089b16b56026d831136362baeb97637ec (patch)
tree01fafaac0bff0aae23cdd83d9a9bd4025e9e4c4e
parent83089069fbf2916256fbd299afe040be3cb5b246 (diff)
Bugfix for display issue with adding codes to the list when skipping
-rw-r--r--main.go15
1 files changed, 6 insertions, 9 deletions
diff --git a/main.go b/main.go
index 5039c0a..10a72b1 100644
--- a/main.go
+++ b/main.go
@@ -377,20 +377,17 @@ func main() {
}
}
}
- // Add the code to CodeList
- CodeList[prayer.Id] = code
- fmt.Println("Added code ", code, " to prayer ", prayer.Id)
+ if code != "" {
+ // If the code is not empty, add it to the code list
+ // and write the code list to CodeList.csv
+ CodeList[prayer.Id] = code
+ WriteCodeList(CodeList)
+ }
// Ask if the user wants to identify another prayer
// or if they want to quit
- // To identify another prayer, continue
- // To quit, save the CodeList and quit
fmt.Print("Identify another prayer? (y/n) ")
answer := prompt.MustRead[string]()
if answer == "n" {
- err = WriteCodeList(CodeList)
- if err != nil {
- panic(err)
- }
break
}
}