linting and formatting
This commit is contained in:
12
cmd/main.go
12
cmd/main.go
@@ -12,8 +12,8 @@ import (
|
||||
todohandler "gitea.michaelthomson.dev/mthomson/habits/internal/todo/handler"
|
||||
todorepository "gitea.michaelthomson.dev/mthomson/habits/internal/todo/repository/postgres"
|
||||
todoservice "gitea.michaelthomson.dev/mthomson/habits/internal/todo/service"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
_ "github.com/jackc/pgx/v5/stdlib"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
)
|
||||
|
||||
func main() {
|
||||
@@ -27,7 +27,7 @@ func main() {
|
||||
postgresUrl := "postgres://todo:password@localhost:5432/todo"
|
||||
db, err := sql.Open("pgx", postgresUrl)
|
||||
if err != nil {
|
||||
log.Fatal("Failed to open db pool")
|
||||
log.Fatalf("Failed to open db pool: %v", err)
|
||||
}
|
||||
defer db.Close()
|
||||
|
||||
@@ -51,9 +51,13 @@ func main() {
|
||||
|
||||
// create server
|
||||
server := &http.Server{
|
||||
Addr: ":8080",
|
||||
Addr: ":8080",
|
||||
Handler: mux,
|
||||
}
|
||||
|
||||
server.ListenAndServe()
|
||||
err = server.ListenAndServe()
|
||||
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to start server: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user