Skip to content

Commit 0c85506

Browse files
Merge pull request #9669 from Kisesy/update-gin
[go/gin] Ensure rows are closed
2 parents 373860f + abdb333 commit 0c85506

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

frameworks/Go/gin/gin-src/hello.go

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ func fortunes(c *gin.Context) {
9999
c.AbortWithError(500, err)
100100
return
101101
}
102+
defer rows.Close() // Ensure rows are closed
102103

103104
fortunes := make(Fortunes, 0)
104105
for rows.Next() { //Fetch rows

frameworks/Go/gin/gin-std/main.go

+1
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ func fortunes(c *gin.Context) {
9999
c.AbortWithError(500, err)
100100
return
101101
}
102+
defer rows.Close() // Ensure rows are closed
102103

103104
fortunes := make(Fortunes, 0)
104105
for rows.Next() { //Fetch rows

0 commit comments

Comments
 (0)