Switch from in-memory to SQLite storage
This commit is contained in:
parent
e55ca30d20
commit
23647d74fc
6 changed files with 288 additions and 40 deletions
3
main.go
3
main.go
|
|
@ -16,7 +16,8 @@ func main() {
|
|||
log.Fatal("can't parse templates: ", err)
|
||||
}
|
||||
h.tmpl = templates
|
||||
h.s = NewStore()
|
||||
// #todo: error handling
|
||||
h.s, _ = NewStore("./foo.db")
|
||||
|
||||
h.s.saveCake(cake{"Sernik ulubiony", -1, 65, 0})
|
||||
h.s.saveCake(cake{"Malinowa chmurka", -1, 150, 0})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue