diff options
Diffstat (limited to 'server')
-rw-r--r-- | server/database/people.go | 5 | ||||
-rw-r--r-- | server/main.go | 2 | ||||
-rw-r--r-- | server/router/router.go | 3 |
3 files changed, 5 insertions, 5 deletions
diff --git a/server/database/people.go b/server/database/people.go index 5fc3bf5..4817139 100644 --- a/server/database/people.go +++ b/server/database/people.go @@ -14,7 +14,7 @@ import ( _ "github.com/mattn/go-sqlite3" ) type Person struct { - ID string + ID int Name string Address string Phone string @@ -28,7 +28,8 @@ func GetAllPeople() []Person { ) var ( - id, name, address, phone, email string + id int + name, address, phone, email string ) for rows.Next() { diff --git a/server/main.go b/server/main.go index 2f0d87f..287e4cc 100644 --- a/server/main.go +++ b/server/main.go @@ -13,8 +13,10 @@ package main import ( router "github.com/MikunoNaka/openbills/router" + db "github.com/MikunoNaka/openbills/database" ) func main() { + db.InitDB() router.InitRouter() } diff --git a/server/router/router.go b/server/router/router.go index 80e9dfc..7729dd2 100644 --- a/server/router/router.go +++ b/server/router/router.go @@ -11,12 +11,9 @@ package router import ( "github.com/gin-gonic/gin" "github.com/gin-gonic/contrib/static" - - db "github.com/MikunoNaka/openbills/database" ) func InitRouter() { - db.InitDB() myRouter := gin.New() myRouter.Use(gin.Logger()) |