Test Tear Down Helper Function Example
//TestDBTearDown closes test db connection | |
func TestDBTearDown(db *sql.DB) error { | |
log.Info("Closing connection to test database") | |
err := db.Close() | |
if err != nil { | |
log.WithFields(log.Fields{ | |
"err": err, | |
}).Warn("Closing db connection resulted in error") | |
return err | |
} | |
return nil | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment