summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--goboom.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/goboom.go b/goboom.go
index b8050c4..ac5e84f 100644
--- a/goboom.go
+++ b/goboom.go
@@ -70,6 +70,10 @@ func addIfNotContains(items []string, item string) []string {
}
func openDB() map[string]int {
+ if _, err := os.Stat(dbFilePath); err != nil {
+ return make(map[string]int)
+ }
+
list := CmdList{}
file, _ := os.Open(dbFilePath)
if err := gocsv.UnmarshalFile(file, &list); err != nil {