Which method in the database/sql package is used to close a database connection?
- Close
- Shutdown
- Disconnect
- End
The correct option is Close. In Go's database/sql package, the Close method is used to close a database connection explicitly. It's essential to close connections properly to release resources and prevent leaks.
Loading...