mirror of
https://github.com/syumai/workers.git
synced 2025-03-10 17:29:11 +00:00
close DB in mysql-blog-server exmaple
This commit is contained in:
parent
11042f5762
commit
7025700201
@ -37,6 +37,7 @@ func (h *articleHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
if err != nil {
|
||||
log.Fatalf("failed to connect: %v", err)
|
||||
}
|
||||
defer db.Close()
|
||||
|
||||
switch req.Method {
|
||||
case http.MethodGet:
|
||||
|
Loading…
x
Reference in New Issue
Block a user