fixtures

package module
v0.3.3 Latest Latest
Warning

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

Go to latest
Published: Aug 7, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

README

Fixtures

Tiny golang fixtures library

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Get added in v0.3.2

func Get[T any](t Testing, f Fixture, name string, opts ...Option[T]) T

func GetList

func GetList[T any](t Testing, f Fixture, name string, opts ...Option[T]) []T

func GetMap

func GetMap[T any](t Testing, f Fixture, name string) map[string]T

Types

type Fixture

type Fixture struct {
	// contains filtered or unexported fields
}

func Load

func Load(path string) (Fixture, error)

func MustLoad

func MustLoad(path string) Fixture

type Option added in v0.2.0

type Option[T any] func(*options[T])

func WithEditor added in v0.2.0

func WithEditor[T any](editor func(value *T)) Option[T]

type Testing added in v0.3.3

type Testing interface {
	Fatalf(msg string, args ...any)
}

Jump to

Keyboard shortcuts

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