modified: main.go
fix loosed breackeds
This commit is contained in:
@@ -22,7 +22,7 @@ type User struct {
|
|||||||
|
|
||||||
func handler(w http.ResponseWriter, r *http.Request) {
|
func handler(w http.ResponseWriter, r *http.Request) {
|
||||||
// Get DB connection from context
|
// Get DB connection from context
|
||||||
db, ok := r.Context().Value("db").(*gorm.DB
|
db, ok := r.Context().Value("db").(*gorm.DB)
|
||||||
if !ok {
|
if !ok {
|
||||||
http.Error(w, "Database connection not found", http.StatusInternalServerError)
|
http.Error(w, "Database connection not found", http.StatusInternalServerError)
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user