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
+19.1k Mac OSX : Homebrew and Golang
+9.7k Random number generation with crypto/rand in Go
+15.6k Chrome : ERR_INSECURE_RESPONSE and allow Chrome browser to load insecure content
+22.9k Golang : Test file read write permission example
+21.2k Golang : Clean up null characters from input data
+12.1k Golang : Perform sanity checks on filename example
+6k Golang : How to verify input is rune?
+14k Golang : Human readable time elapsed format such as 5 days ago
+14k Golang : Google Drive API upload and rename example
+20.5k Golang : Pipe output from one os.Exec(shell command) to another command
+10.6k Golang : Bubble sort example
+17.5k Golang : Linked list example