Categorygithub.com/Guiwoo/TestDBWrapper
repositorypackage
0.1.0
Repository: https://github.com/guiwoo/testdbwrapper.git
Documentation: pkg.go.dev

# README

This is for the Repository Test Transaction RollBack

Do not want to write a code every single time when I create a new Project.

How To Use


func Test_Rollback(t *testing.T) {
	testDB := NewTestDB(&gorm.DB{})
    
	testDB.RunWithRollback(func(tx *gorm.DB) error) error {
        // Do something with tx
        return nil
    })
}