Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • G go
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • Deployments
    • Deployments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar
  • Kirill Smelkov
  • go
  • Repository
  • go
  • src
  • pkg
  • database
  • sql
  • sql.go
Find file BlameHistoryPermalink
  • Nigel Tao's avatar
    database/sql: add "defer rows.Close()" to the example code. · 50ca1a52
    Nigel Tao authored Mar 25, 2014
    Strictly speaking, it's not necessary in example_test.go, as the
    Rows.Close docs say that "If Next returns false, the Rows are closed
    automatically". However, if the for loop breaks or returns early, it's
    not obvious that you'll leak unless you explicitly call Rows.Close.
    
    LGTM=bradfitz
    R=bradfitz
    CC=golang-codereviews, rsc
    https://golang.org/cl/79330043
    50ca1a52
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7