testhelpers

module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 6, 2021 License: Apache-2.0

README

Test helpers

  • DB
Usage
import (
    "github.com/imega/txwrapper"
    "github.com/imega/testhelpers/db"
)

func Test_MyTest(t *testing.T) {
    tx := func(ctx context.Context, tx *sql.Tx) error {
        // your code

        return nil
    }

    db, closedb, err := db.Create("dbname", tx)
    if err != nil {
        t.Fatalf("failed to create db, %s", err)
    }
    defer closedb()

    // ...

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL