Golang database/sql.DB.Ping function example
package database/sql
Ping verifies a connection to the database is still alive, establishing a connection if necessary.
Golang database/sql.DB.Ping function usage example
...
db, err := Open(driverName, dataSourceName)
if err != nil {
return db, err
}
err = db.Ping() // try to ping database server
return db, err
...
Reference :
Advertisement
Something interesting
Tutorials
+6.3k Golang : Calculate US Dollar Index (DXY)
+7.9k Golang : Grayscale Image
+4k Detect if Google Analytics and Developer Media are loaded properly or not
+8.7k Golang : How to join strings?
+38.1k Golang : Read a text file and replace certain words
+12.8k Golang : Convert int(year) to time.Time type
+7.1k Golang : Validate credit card example
+23.5k Golang : Get ASCII code from a key press(cross-platform) example
+13.7k Golang : Image to ASCII art example
+5.3k Javascript : Change page title to get viewer attention
+10.2k Golang : Random Rune generator