test

package
v0.0.0-...-523c5c6 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2025 License: MIT Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var InitialData = []User{
	{
		ID:        1,
		Name:      "Alice",
		Age:       20,
		GroupID:   sql.Null[int]{Valid: true, V: 1},
		CreatedAt: time.Now(),
	},
	{
		ID:        2,
		Name:      "Bob",
		Age:       21,
		GroupID:   sql.Null[int]{Valid: true, V: 1},
		CreatedAt: time.Now(),
	},
	{
		ID:        3,
		Name:      "Charlie",
		Age:       22,
		GroupID:   sql.Null[int]{},
		CreatedAt: time.Now(),
	},
	{
		ID:        4,
		Name:      "David",
		Age:       23,
		GroupID:   sql.Null[int]{Valid: true, V: 2},
		CreatedAt: time.Now(),
	},
}

Functions

func AssertUser

func AssertUser(t *testing.T, expected, actual User)

func AssertUsers

func AssertUsers(t *testing.T, expected, actual []User)

func NewDB

func NewDB(t *testing.T, opts ...dbtest.Option) *sqlx.DB

Types

type User

type User struct {
	ID        int           `db:"id"`
	Name      string        `db:"name"`
	Age       int           `db:"age"`
	GroupID   sql.Null[int] `db:"group_id"`
	CreatedAt time.Time     `db:"created_at"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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