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
+8.6k Golang : Add text to image and get OpenCV's X, Y co-ordinates example
+11.3k Golang : Intercept and process UNIX signals example
+36.5k Golang : Save image to PNG, JPEG or GIF format.
+5.6k Golang : Configure crontab to poll every two minutes 8am to 6pm Monday to Friday
+17.7k Golang : [json: cannot unmarshal object into Go value of type]
+5.6k Golang : Shortening import identifier
+9.3k Golang : How to get ECDSA curve and parameters data?
+5.2k Golang : Convert lines of string into list for delete and insert operation
+6.1k Golang : Debug with Godebug
+9.4k Golang : Scramble and unscramble text message by randomly replacing words
+18.4k Golang : Read binary file into memory
+9.1k Golang : io.Reader causing panic: runtime error: invalid memory address or nil pointer dereference