Skip to content

Commit

Permalink
DRY up the database file path
Browse files Browse the repository at this point in the history
  • Loading branch information
claudealdric committed Sep 28, 2024
1 parent 720987a commit 9966073
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ import (
"github.com/claudealdric/go-todolist-restful-api-server/data"
)

const dbFilePath = "./data/data.db"
const port = 8080

func main() {
os.Remove("./data/data.db")
db, err := sql.Open("sqlite3", "./data/data.db")
os.Remove(dbFilePath)
db, err := sql.Open("sqlite3", dbFilePath)
if err != nil {
log.Fatal(err)
}
Expand Down

0 comments on commit 9966073

Please sign in to comment.