package db import ( _ "github.com/mattn/go-sqlite3" "github.com/naoina/genmai" "app/model" "github.com/gin-gonic/gin" "fmt" ) var DB *genmai.DB func InitDB() { var err error DB, err = genmai.New(&genmai.SQLite3Dialect{}, ":memory:") if err != nil { panic(err) } if err := DB.CreateTable(&model.Todo{}); err != nil { panic(err) } initData := []model.Todo{ {1, "なんかやる", false}, {2, "なんかやる2", true}, } i