Reformatting a lil sry.
This commit is contained in:
parent
5874be563d
commit
fb7a98e823
2 changed files with 14 additions and 16 deletions
30
main.go
30
main.go
|
|
@ -9,6 +9,20 @@ import (
|
||||||
_ "github.com/mattn/go-sqlite3"
|
_ "github.com/mattn/go-sqlite3"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func check(e error) {
|
||||||
|
if e != nil {
|
||||||
|
panic(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func prep_query(db *sql.DB, q string) (*sql.Stmt){
|
||||||
|
statement, err := db.Prepare(q)
|
||||||
|
|
||||||
|
check(err)
|
||||||
|
|
||||||
|
return statement
|
||||||
|
}
|
||||||
|
|
||||||
type User struct {
|
type User struct {
|
||||||
id int64
|
id int64
|
||||||
name string
|
name string
|
||||||
|
|
@ -58,22 +72,6 @@ type Entity struct {
|
||||||
spawn_line string
|
spawn_line string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
func check(e error) {
|
|
||||||
if e != nil {
|
|
||||||
panic(e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func prep_query(db *sql.DB, q string) (*sql.Stmt){
|
|
||||||
statement, err := db.Prepare(q)
|
|
||||||
|
|
||||||
check(err)
|
|
||||||
|
|
||||||
return statement
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
func reset_database(db *sql.DB) {
|
func reset_database(db *sql.DB) {
|
||||||
dat, _ := os.ReadFile("setup.sql")
|
dat, _ := os.ReadFile("setup.sql")
|
||||||
queries := strings.Split(string(dat), ";")
|
queries := strings.Split(string(dat), ";")
|
||||||
|
|
|
||||||
BIN
rpgqui.db
BIN
rpgqui.db
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue