Skip to content

Commit

Permalink
prepare db format
Browse files Browse the repository at this point in the history
  • Loading branch information
laktak committed Dec 30, 2024
1 parent 63eb070 commit ebd5816
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions store.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,15 @@ func ExportIndexDb(path, indexName string) error {
if err != nil {
return err
}
defer connR.Close()

file, err := os.Create(getDbFile(path, indexName, ".json"))
if err != nil {
return err
}
defer file.Close() // Ensure the file is closed when the function exits
defer file.Close()

_, err = file.WriteString("{")
_, err = file.WriteString(`{"type":"chkbit","version":6,"data":{`)
if err != nil {
return err
}
Expand Down Expand Up @@ -231,7 +232,7 @@ func ExportIndexDb(path, indexName string) error {
return ierr
})

_, err = file.WriteString("}")
_, err = file.WriteString("}}")
if err != nil {
return err
}
Expand Down

0 comments on commit ebd5816

Please sign in to comment.