testutil

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2025 License: MIT Imports: 5 Imported by: 0 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 Cupaloy = cupaloy.New(cupaloy.SnapshotSubdirectory("testdata/snapshots"))

Functions

func GetClientFromContext

func GetClientFromContext(ctx context.Context) (graphql.Client, error)

func GetClientFromMyContext

func GetClientFromMyContext(ctx MyContext) (graphql.Client, error)

func GetClientFromNowhere

func GetClientFromNowhere() (graphql.Client, error)

func MarshalDate added in v0.2.0

func MarshalDate(t *time.Time) ([]byte, error)

func UnmarshalDate added in v0.2.0

func UnmarshalDate(b []byte, t *time.Time) error

Types

type ID

type ID string

type MyContext

type MyContext interface {
	context.Context

	MyMethod()
}

type Option added in v0.7.0

type Option[V any] struct {
	// contains filtered or unexported fields
}

func FromPtr added in v0.7.0

func FromPtr[V any](ptr *V) Option[V]

func None added in v0.7.0

func None[V any]() Option[V]

func Some added in v0.7.0

func Some[V any](value V) Option[V]

func (Option[V]) Get added in v0.7.0

func (v Option[V]) Get(fallback V) V

func (Option[V]) MarshalJSON added in v0.7.0

func (value Option[V]) MarshalJSON() ([]byte, error)

func (*Option[V]) UnmarshalJSON added in v0.7.0

func (value *Option[V]) UnmarshalJSON(data []byte) error

func (Option[V]) Unpack added in v0.7.0

func (v Option[V]) Unpack() (V, bool)

type Pokemon

type Pokemon struct {
	Species string `json:"species"`
	Level   int    `json:"level"`
}

func (Pokemon) Battle

func (p Pokemon) Battle(q Pokemon) bool

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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