-
-
Save clairew/1a7dfe2a6684e462effec5e2d42f4623 to your computer and use it in GitHub Desktop.
Test Tear Down Helper Function Example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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