diff options
-rw-r--r-- | main.go | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -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 } } |