Deleted no more needed code for closing of a guestbook DB inside a Handlers struct.
This commit is contained in:
parent
e856a4b930
commit
1b61434623
@ -66,7 +66,6 @@ func main() {
|
|||||||
defer mindflowDB.Close()
|
defer mindflowDB.Close()
|
||||||
|
|
||||||
hand := http.NewHandlers(*captchaExpiry, *guestbookOwner, *guestbookPageSize, guestbookDB, mindflowDB)
|
hand := http.NewHandlers(*captchaExpiry, *guestbookOwner, *guestbookPageSize, guestbookDB, mindflowDB)
|
||||||
defer hand.CloseDB()
|
|
||||||
|
|
||||||
srv := http.NewHttpServer()
|
srv := http.NewHttpServer()
|
||||||
|
|
||||||
|
@ -34,10 +34,6 @@ func NewHandlers(captchaExpire time.Duration, gbOwner string, gbPageSize int64,
|
|||||||
guestbookPageSize: gbPageSize}
|
guestbookPageSize: gbPageSize}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *Handlers) CloseDB() {
|
|
||||||
h.guestbookDB.Close()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (h *Handlers) Index(w http.ResponseWriter, r *http.Request) {
|
func (h *Handlers) Index(w http.ResponseWriter, r *http.Request) {
|
||||||
web.Index("", w)
|
web.Index("", w)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user